If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > SQL code

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-05, 16:42
Artik Artik is offline
Registered User
 
Join Date: Jan 2005
Posts: 10
SQL code

In Oracle you can test wheter an SQL statement succceded or failed using the sqlca.sqlcode value

Is there such a thing in Informix (to use in a stored procedure) ?
Reply With Quote
  #2 (permalink)  
Old 03-04-05, 16:46
artemka artemka is offline
Registered User
 
Join Date: May 2004
Location: New York
Posts: 248
i have done something like this, but I'm testing for more then one row in thes case.

DEFINE l_sql_err INTEGER;
DEFINE l_isam_err INTEGER;
DEFINE l_err_txt CHAR(60);

FOREACH
SELECT field
INTO scratch
FROM tabname
WHERE .........................

ON EXCEPTION
SET l_sql_err, l_isam_err, l_err_txt
IF l_sql_err = -284
THEN
-- Do Nothing
END IF
END EXCEPTION

-- rest of your own code here


END FOREACH

Hope this helps

Cheers
Reply With Quote
  #3 (permalink)  
Old 03-07-05, 11:33
Artik Artik is offline
Registered User
 
Join Date: Jan 2005
Posts: 10
Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On