This is a discussion on Stop executing stored procedure within the Informix forums, part of the Database Server Software category; --> Hi, How can I stop executing procdure after some condition? e.g. create procedure myproc(nr integer) if nr > 0 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| IF CONDITION THEN RETURN; END IF Paul Watson Tel: +44 1414161772 Mob: +44 7818003457 Web: www.oninit.com GO FURTHER with DB2 GET THERE FASTER with Informix. Attend the IDUG 2006 European Conference. Vienna, Austria. 2-6 October 2006 Visit http://www.iiug.org/conf for more information. -----Original Message----- From: maxskalski@gmail.com [mailto:maxskalski@gmail.com] Posted At: 03 August 2006 06:53 Posted To: comp.databases.informix Conversation: Stop executing stored procedure Subject: Stop executing stored procedure Hi, How can I stop executing procdure after some condition? e.g. create procedure myproc(nr integer) if nr > 0 then 'here I want to stop executing and exit procedure' end if |
| |||
| On 3 Aug 2006 04:53:16 -0700, maxskalski@gmail.com wrote: > How can I stop executing procdure after some condition? > e.g. > > if nr > 0 then > 'here I want to stop executing and exit procedure' > end if This looks like it might be an error condition - maybe you should use RAISE instead of the EXIT and RETURN options already suggested. Error -745 is reserved for your use; you can generate a message text of your own choosing. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/ |
| |||
| Jonathan Leffler wrote: > On 3 Aug 2006 04:53:16 -0700, maxskalski@gmail.com wrote: >> How can I stop executing procdure after some condition? >> e.g. >> >> if nr > 0 then >> 'here I want to stop executing and exit procedure' >> end if > > > This looks like it might be an error condition - maybe you should use > RAISE instead of the EXIT and RETURN options already suggested. Error > -745 is reserved for your use; you can generate a message text of your > own choosing. > > ITYM -746 -- rh |
| ||||
| Richard Harnden wrote: > Jonathan Leffler wrote: > > On 3 Aug 2006 04:53:16 -0700, maxskalski@gmail.com wrote: > >> How can I stop executing procdure after some condition? > >> e.g. > >> > >> if nr > 0 then > >> 'here I want to stop executing and exit procedure' > >> end if > > > > This looks like it might be an error condition - maybe you should use > > RAISE instead of the EXIT and RETURN options already suggested. Error > > -745 is reserved for your use; you can generate a message text of your > > own choosing. > > ITYM -746 See what happens when your brain goes on holiday and your fingers don't! :-) Yes, I did mean -746. |