Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: [student] Simple SQL report.

Re: [student] Simple SQL report.

From: Ulf Magnusson <ulf.magnusson_at_briunix.kiedt.ericsson.se>
Date: Fri, 2 Oct 1998 12:35:14 +0200
Message-ID: <6v29lk$drq@newstoo.ericsson.se>


Hello

    Your INITDATE and ENDDATE are charachter datatype, then you have to use single quotas (').

    Try it, I think that's the problem.

/Ulf

>**********************************************
> 1 ACCEPT INITDATE DATE PROMPT 'Enter value for start date: '
> 2 ACCEPT ENDDATE DATE PROMPT 'Enter value for end date: '
> 3 SELECT ENAME, HIREDATE
> 4 FROM EMP
> 5* WHERE HIREDATE BETWEEN &INITDATE AND &ENDDATE;
>**********************************************
>
>And getting these results:
>
>**********************************************
>SQL> @GETHIREDATES
>Enter value for start date: 1-JAN-81
>Enter value for end date: 1-JAN-82
>old 3: WHERE HIREDATE BETWEEN &INITDATE AND &ENDDATE
>new 3: WHERE HIREDATE BETWEEN 1-JAN-81 AND 1-JAN-82
>WHERE HIREDATE BETWEEN 1-JAN-81 AND 1-JAN-82
> *
>ERROR at line 3:
>ORA-00904: invalid column name
Received on Fri Oct 02 1998 - 05:35:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US