Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [student] Simple SQL report.
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