Stored Procedure.
Posted in 2010
A user with IDS 11 and a .NET front end asked how a stored procedure can detect whether its four inserts/updates succeeded and pass that status back to the application. Replies were thin: one simply said "RTFM", another suggested checking SQLCA.SQLCODE (0 = success) and SQLCA.SQLERRD[3] for rows affected, per the Informix Guide to SQL Syntax, and a third vaguely pointed at DBINFO(). The poster said SQLCA.SQLCODE didn't work for him from .NET and repeated his request for an example; the thread ends there with no resolution recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL
hi guys, I need you to help me: Well, in my stored procedure I have 4 instructions that insert in 2 tables and the others 2 for update, but how can I know with a stament or instruction if someone of my inserts or updates fail. Because I need an answeer or value of informix to say me if the transaction do it well and that value returns to my application. I hope you understand that I want it. Regads....
CARLOS LINO wrote: > hi guys, I need you to help me: > > Well, in my stored procedure I have 4 instructions that insert in 2 tables and > the others 2 for update, but how can I know with a stament or instruction > if someone of my inserts or updates fail. Because I need an answeer or value > of informix to say me if the transaction do it well and that value returns to > my application. It's been ages since I've been able to say this, so "hooray for you". RTFM. -- Cheers, Obnoxio The Clown http://obotheclown.blogspot.com I will now proceed to pleasure myself with this fish. -- This message has been scanned for viruses and dangerous content by OpenProtect(http://www.openprotect.com), and is believed to be clean.
> -----Original Message----- > From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of > Obnoxio The Clown > Sent: Friday, September 10, 2010 9:46 AM > To: ids@iiug.org > Subject: Re: Stored Procedure. [21222] > > CARLOS LINO wrote: > > hi guys, I need you to help me: > > > > Well, in my stored procedure I have 4 instructions that insert in 2 > tables > and > > the others 2 for update, but how can I know with a stament or > instruction > > if someone of my inserts or updates fail. Because I need an answeer > or value > > of informix to say me if the transaction do it well and that value > returns > to > > my application. > > It's been ages since I've been able to say this, so "hooray for you". > > RTFM. > Carlos- I usually look at SQLCA.SQLCODE and SQLCA.SQLERRD[3]. Successful operations should have an SQLCA.SQLCODE = 0 and SQLCA.SQLERRD[3] = number of rows affected. Look in the Informix Guide to SQL Syntax for more info. Also, you didn't say what your Informix version, platform and client are. If you're using .Net or Ruby on Rails or something, my suggestion may be worse than useless.... --EEM > -- > Cheers, > Obnoxio The Clown > > http://obotheclown.blogspot.com > I will now proceed to pleasure myself with this fish. > > -- > This message has been scanned for viruses and > dangerous content by OpenProtect(http://www.openprotect.com), and is > believed to be clean. > > > *********************************************************************** > ******** > Forum Note: Use "Reply" to post a response in the discussion forum.
hi Everett Mills: I'm using informix IDS 11 and .NET for my application. I tried with SQLCA.SQLCODE but it doesn't work. Regards..
Look for dbinfo() syntax. I don't have exact systan handy but I am sure this will provide you an answer you are looking for. Regards, Dharmendra > To: ids@iiug.org > From: carlos_lv8@hotmail.com > Subject: Stored Procedure. [21221] > Date: Fri, 10 Sep 2010 10:43:39 -0400 > > hi guys, I need you to help me: > > Well, in my stored procedure I have 4 instructions that insert in 2 tables and > the others 2 for update, but how can I know with a stament or instruction > if someone of my inserts or updates fail. Because I need an answeer or value > of informix to say me if the transaction do it well and that value returns to > my application. > > I hope you understand that I want it. > > Regads.... > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. >
That was classy. --- On Fri, 9/10/10, Obnoxio The Clown <obnoxio@serendipita.com> wrote: From: Obnoxio The Clown <obnoxio@serendipita.com> Subject: Re: Stored Procedure. [21222] To: ids@iiug.org Date: Friday, September 10, 2010, 10:46 AM CARLOS LINO wrote: > hi guys, I need you to help me: > > Well, in my stored procedure I have 4 instructions that insert in 2 tables and > the others 2 for update, but how can I know with a stament or instruction > if someone of my inserts or updates fail. Because I need an answeer or value > of informix to say me if the transaction do it well and that value returns to > my application. It's been ages since I've been able to say this, so "hooray for you". RTFM. -- Cheers, Obnoxio The Clown http://obotheclown.blogspot.com I will now proceed to pleasure myself with this fish. -- This message has been scanned for viruses and dangerous content by OpenProtect(http://www.openprotect.com), and is believed to be clean. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Walter Lowich wrote: > That was classy. I'm a classy guy. -- Cheers, Obnoxio The Clown http://obotheclown.blogspot.com I will now proceed to pleasure myself with this fish. -- This message has been scanned for viruses and dangerous content by OpenProtect(http://www.openprotect.com), and is believed to be clean.
Please help me, I need this urgently.. If you have an example will be much better.