Home » SQL & PL/SQL » SQL & PL/SQL » exiting plsql block (oracle plsql,9i,xp)
exiting plsql block [message #346570] Mon, 08 September 2008 23:11 Go to next message
yoonus.it@gmail.com
Messages: 109
Registered: June 2007
Location: kuwait
Senior Member

Hi,

Is there a way to exit plsql block if something goes wrong.
i want this to happen in normal plsql block not inside loop. In vb we can use exit sub. is there anythin of that kind here?

Thanks in Advance Smile
Re: exiting plsql block [message #346572 is a reply to message #346570] Mon, 08 September 2008 23:16 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW the Posting Guidelines as stated in URL above

Unwilling or incapable to Read The Fine Manual?

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/exit_statement.htm#sthref2700


>Is there a way to exit plsql block if something goes wrong.
How do you determine when "something goes wrong"?

[Updated on: Mon, 08 September 2008 23:18] by Moderator

Report message to a moderator

Re: exiting plsql block [message #346575 is a reply to message #346570] Mon, 08 September 2008 23:24 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Maybe RETURN

Regards
Michel
Re: exiting plsql block [message #346601 is a reply to message #346575] Tue, 09 September 2008 01:46 Go to previous messageGo to next message
milind.khadloya
Messages: 4
Registered: September 2008
Location: India
Junior Member

Exception (error handling) block can be use for this purpose. You can define your own exception and raise the same at particular condition.
Re: exiting plsql block [message #347610 is a reply to message #346572] Fri, 12 September 2008 05:48 Go to previous messageGo to next message
yoonus.it@gmail.com
Messages: 109
Registered: June 2007
Location: kuwait
Senior Member
I am sorry anacedent. Actually what i thought was if someone can just give me alink to that or tell me i dont have to spend time on that. That was what in my mind.
Re: exiting plsql block [message #347611 is a reply to message #346601] Fri, 12 September 2008 05:50 Go to previous message
yoonus.it@gmail.com
Messages: 109
Registered: June 2007
Location: kuwait
Senior Member
Thanks Milind. That is very helpful and now i am handling very gracefully.

Previous Topic: send a mail from pl/sql
Next Topic: ORA-12043: invalid CREATE MATERIALIZED VIEW option
Goto Forum:
  


Current Time: Fri Dec 09 13:13:09 CST 2016

Total time taken to generate the page: 0.10535 seconds