Unix Technical Forum

Stop executing stored procedure

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 ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 12:43 PM
maxskalski@gmail.com
 
Posts: n/a
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 12:43 PM
Paul Watson
 
Posts: n/a
Default Re: Stop executing stored procedure

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 12:44 PM
Jonathan Leffler
 
Posts: n/a
Default Re: Stop executing stored procedure

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/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 12:44 PM
Richard Harnden
 
Posts: n/a
Default Re: Stop executing stored procedure

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-20-2008, 12:45 PM
Jonathan Leffler
 
Posts: n/a
Default Re: Stop executing stored procedure


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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:02 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com