Re: PLSQL cursor limitations

From: Thomas J Kyte <tkyte_at_us.oracle.com>
Date: 1995/06/23
Message-ID: <3sehpt$qva_at_inet-nntp-gw-1.us.oracle.com>#1/1


miff_at_ix.netcom.com (miff ) wrote:
>has anyone else had trouble declaring any but the most primitive
>cursors in plsql? Either I am doing something wrong, or one cannot use
>parentheses or subselects in a cursor...
>
>DECLARE
> CURSOR C1 IS
> SELECT DISTINCT A.data1, A.data2, A.data3
> FROM table1 A
> WHERE NOT EXISTS (SELECT * from table2 B
> WHERE (A.data1 = B.data1
> AND A.data2 = B.data2
> AND A.data3 = B.data3) );
>
>the error I got on this baby was --> " Found '(' when looking for [a
>bunch of other stuff].
>
>should I even bother using cursors?
>
>-miff

What version of Oracle? What OS

BTW, it would be very helpful if everyone supplied things like Operating system, Oracle version, whether they are client/server, etc.

I did this in 7.1.3 and 7.0.15 on Sun/OS without a problem. Oracle Case, Oracle Replication, and many other Oracle products have cursors infinitely more complex then the above.

Check that you either
- OWN table1 and table2
OR
- you have been granted select on table1 and table2 directly (NOT via a role) (maybe the error message is wrong and there is some other problem with the query)

  • that table1 and table2 have the structure you think they do

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government Received on Fri Jun 23 1995 - 00:00:00 CEST

Original text of this message