Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to exit a PLSQL program

223563Mar 29 2002
Looking for a way to exit a PLSQL program before reaching the end. Probable use would be to trap some sort of condition, output a message and then "exit". The "exit" command provided seems to have been designed to "break" out of loops. Failing to find anything that looks like exit in the index of my "Oracle PL/SQL Programming" manual (looked for "exit", "quit", "finish", "stop", "bye" etc...) I decided to write this note.

I also tried to "goto" a label which was at the end of the PLSQL program. It failed with unspecified compilation errors. A test program also failed...

create or replace procedure try as
x number;
begin
goto over;
dbms_output.put_line('Hi There');
<<over>>
end try;
/

Q: How does one exit a PLSQL?
Q: Why doesn't the little try program above not compile?




Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2002
Added on Mar 29 2002
1 comment
710 views