Re: oracle error 'Missing Keyword' ora 00905

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 17 May 2002 01:15:02 -0700
Message-ID: <a20d28ee.0205170015.7a00b9e9_at_posting.google.com>


klmtechnology_at_consultant.com (Zo) wrote in message news:<b0d0f796.0205160748.120a72f5_at_posting.google.com>...
> Here's the code:
> v_rangeFrom :=' SELECT unique (add_months(last_day(
> bus_cal_d)+1,-1)) '||
> ' FROM cscadmin.business_calendar '||
> ' WHERE to_CHAR(bus_cal_d,'|| chr(39)||
> 'MON,YYYY' || chr(39) ||') = (SELECT to_char(date_d,'|| chr(39) ||
> 'MON,YYYY' || chr(39) ||') ' ||
>
> ' FROM TIME_DIMN ' ||
>
> ' WHERE tme_dimn_i = ' || chr(39) || 'TDTD' ||
> chr(39) ||') ';
>
> In dynamic pl/sql, I'm trying to extract a date and set to a variable,
> v_rangeFrom is showing the entire select statement if I were to print
> out the variable. I'm trying to extract a specific date from a table
> to load into the variable, but I'm getting an oracle ora 00905 error
> keyword missing.
>
> help please???

unique doesn't exist in Oracle, it is distinct. In the future, the best strategy to solve this yourself is spool the generated statement to a file, and load the file in sql*plus. Sql*plus will locate the exact location of the error.

Hth

Sybrand Bakker
Senior Oracle DBA Received on Fri May 17 2002 - 10:15:02 CEST

Original text of this message