| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Explicit Cursor in a For Loop and crashing database
Could not find the error, what is the Oracle saying (error number)?
BTW, I would rewrite your code as following:
INSERT INTO my_table(col1
, col2...)
SELECT x1,
x2
FROM other_table
WHERE ...
IF SQL%FOUND THEN
INSERT INTO ...
WHEN OTHERS THEN ROLLBACK, RAISE
is not necessary. Exactly this will be done by Oracle if you don`t
write any axception
3) I would use
INSERT INTO my_table (col1...) VALUES (my_sequence.nextval...
instead of
SELECT my_sequence.nextval INTO my_variable FROM DUAL; INSERT INTO my_table (col1...) VALUES (my_variable...
Your aproach is not wrong, but more code. More code, harder to read, etc...
Regards, Jan Received on Tue Sep 23 2003 - 02:21:36 CDT
![]() |
![]() |