Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: DBMS_SQL.PARSE
Hi.
The reason for error that you don't have column named "START_DATE"
in your table.
There 2 possible solutions.
HTH. Michael.
In article <39079F28.BE126D44_at_mindspring.com>,
hclarius_at_mindspring.com wrote:
> I am using DBMS_SQL to generate dynamic cursors to interact
> with Web Server.
>
> I have a date variable in my table called DATE_TIME
>
> I create a local date variable using
> START_DATE:=TO_DATE('01-APR-95)
>
> I create the following varchars (strings).
>
> SERIES_PARM:=' SITES ' ; (SITES is a table)
>
> SITE_PARM:= ' (SITE_ID:=''VB122'') ' ; SITE_ID is a varchar
> in the SITES table.
>
> DATE_PARM:=' (DATE_TIME>=START_DATE) ' ;
>
> ALL_PARMS:='SELECT * FROM ' || SERIES_PARM || ' WHERE ' ||
> SITE_PARM || ' AND ' || DATE_PARM;
>
> The string when printed out looks like
> SELECT * FROM SITES WHERE (SITE_ID='VB122') AND (DATE_TIME
> >= START_DATE)
>
> Then I pass this string as follows
>
> C1:= DBMS_SQL.OPEN_CURSOR; --Allocates a cursor
>
> DBMS_SQL.PARSE(C1,ALL_PARMS,DBMS_SQL.NATIVE);
>
> This Works for SELECT * FROM SITES WHERE (SITE_ID='VB122')
> but I get invalid column error when I tack on the DATE_PARM.
>
> START_DATE IS A VALID DATE AND DATE_TIME IS A DATE IN THE
> SITES TABLE.
>
> Any ideas would be helpful.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Apr 27 2000 - 00:00:00 CDT