Toad World® Forums

Creation procedure/ package by script problem


#1

Hi

I found out this problem (now a small example because my code had many more lines :-))

create PROCEDURE proc
IS
BEGIN
<>
BEGIN
HTP.p (‘Hello’);
END loop;
END proc;

or in a package

CREATE OR REPLACE PACKAGE xpto
IS
PROCEDURE proc;
END xpto;
/
CREATE OR REPLACE PACKAGE BODY xpto
IS
PROCEDURE proc
IS
BEGIN
<>
BEGIN
HTP.p (‘Hello’);
END loop;
END proc;
END xpto;

will give error and cut the code (of the procedure or the body)

That also happens with 6.1.1 but not with 5.5.4!!

I figure out that the problem is the there is a END loop; and that in not really a “end loop” but loop is a label :frowning: Oracle doesn’t gives an error with that when creating the package normally or by script (5.5.4 or sqlplus) :frowning: (loop should be a protected word :-()

Side note: In the example I created the label (<>) to make it easier to understand I had to find that inside the code …6.2 colapsing the code feature was the one that helped me figuring that out :slight_smile:

Regards
Filipe


#2

Hi Filipe,

Yes indeed END LOOP confuses the parser as it searches for the matching LOOP statement and fails. We’ll need to look at this problem later. We plan to replace the parser in a future version.

Since 6.1 wasn’t even able to handle labels correctly and this problem has a workaround (changing the word LOOP to something else), and given the high risk of making changes to the parser at this stage, we decided to postpone addressing the issue to 6.3.

Regards,
Roman

Message was edited by: roman