Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle Error 0 appears when creating cursor

Status
Not open for further replies.

Agnus

Programmer
Jun 21, 2001
11
GB
Hi,
In a rather large form, I'm trying to make a new procedure. All is well until I add the cursor, and then it won't compile. The cursor works fine in SQLPlus, but forms won't compile it - I get Error 0 at line 0(!).

The cursor is something like this:

Cursor c1 is
SELECT ta.trans_id, ta.seq_no
FROM table_a ta, table_b tb
WHERE ta.text1 = tb.text1 -- these are the standard joins
and to_number(ta.action) = tb.code --
and tb.type = 'X'
and ta.trans_id <= (select(max(ta1.trans_id))
from table_a ta1
where ta1.trans_id = ta.trans_id);

- don't worry about the names i've used, and the subquery is a standard one we use here to find the latest
transaction. Anyway, does anyone know anything more about this Error 0? I don't think the form is too big,
as I managed to make another procedure of about the same size, then delete it before starting
this one. What else could Error 0 be alluding to?
thanks in advance ...
 
Found an easy/dirty way to avoid this:
Don't use the cursor! one of the joys(?) of pl/sql is that there's many ways to do the same thing. I relaised I could use a select into instead of a cursor fetch, and the error vanished. Still no idea why it appeared in the first place though. ho hum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top