Re: ORA-00923 error - SQL PLUS

From: ddf <oratune_at_msn.com>
Date: Tue, 22 Apr 2014 09:20:33 -0700 (PDT)
Message-ID: <a49cc507-63b6-4170-8ef1-ad2784c2928d_at_googlegroups.com>


On Tuesday, April 22, 2014 4:05:24 AM UTC-6, ygna..._at_gmail.com wrote:
> When i try the following to create a .txt file in unix script. I couldn't.
>
>
>
>
>
> select to_char(sysdate,'dd/mm/yyyy') "date"||'%'||to_char(sysdate,'dd/mm/yyyy') "fate" from dual;
>
>
>
> Thanks in advance.

The error text says it all:

SQL> select to_char(sysdate,'dd/mm/yyyy') "date"||'%'||to_char(sysdate,'dd/mm/yyyy') "fate" from dual; select to_char(sysdate,'dd/mm/yyyy') "date"||'%'||to_char(sysdate,'dd/mm/yyyy') "fate" from dual

                                           *
ERROR at line 1:
ORA-00923: FROM keyword not found where expected

SQL> You can't do what you're trying to do since you assigned an alias to the column then tried to modify the expression. You CAN do this:

SQL> select to_char(sysdate,'dd/mm/yyyy')||'%'||to_char(sysdate,'dd/mm/yyyy') " date % fate" from dual;

   date % fate



22/04/2014%22/04/2014

SQL> and get a result.

David Fitzjarrell Received on Tue Apr 22 2014 - 18:20:33 CEST

Original text of this message