Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: A PL/SQL compiler bug?
On Fri, 06 Nov 1998 12:12:25 GMT, mhalpeth_at_my-dejanews.com wrote:
>But then are we not talking of a reserved word 'IF' being used as a label ...
>why not try using a diff label name for END LOOP PAPA ... something like this
>...if thats your problem .
Obviously I didn't make myself clear enough in my original post or you didn't read it. I wasn't using the label at the END LOOP statement, it just so happened that Oracle mistakenly took the resreved word ROLLBACK as a label, although it was meant to be a *SQL TCL command*. So once again, consider the following:
BEGIN
FOR i IN 1..10000 LOOP
FOR j IN 1..10000 LOOP
INSERT INTO TABLE test(dummy) VALUES ('BLAHBLAH');
END LOOP
COMMIT;
END LOOP;
END;
Can you see anything unusual in this code? It simply inserts a dummy
string into a table for a 100.000.000 times. And since a rollback
tablespace would probably not be large enough to hold this as a single
transactions it is meant to commit after every 10.000 inserts. But
guess what - it doesn't perform any commit at all!
Because there is a missing semicolumn after the END LOOP statement of the inner loop the compiler takes a COMMIT as a label! Does this seems a normal and acceptable behaviour to you? To me it surely doesn't. I would expect from the compiler to reject this code because of the missing column as it would in all other circumstances. If the offending END LOOP is followed by any other SQL/PLSQL expression then the block refuses to compile and this is what I consider a normal behavior.
>Regards
>
>Mahesh H
Reggards
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)