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 > Informix 723 Spl :how To Get Sqlcode?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-03, 05:03
clark_x clark_x is offline
Registered User
 
Join Date: Sep 2003
Posts: 8
Informix 723 Spl :how To Get Sqlcode?

create procedure test ( col_t1 varchar(30), col_t2 char(1) )
returning varchar(30);
define errno int;
define str char(30);
on exception set errno
return errno;
end exception;

set debug file to '/tmp/t_trc';
trace on;

update oper_table
set oper_id='001'
where oper_id='001';

--trace 'errno ' || errno;

return 10000;
end procedure;

when update statement execute sucess£¬ i cannot get the errno£¬
so HOW TO GET SQLCODE AFTER A STATEMENT SUCCESS EXECUTED£¡
Reply With Quote
  #2 (permalink)  
Old 09-29-03, 09:44
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Re: Informix 723 Spl :how To Get Sqlcode?

Quote:
Originally posted by clark_x
create procedure test ( col_t1 varchar(30), col_t2 char(1) )
returning varchar(30);
define errno int;
define str char(30);
on exception set errno
return errno;
end exception;

set debug file to '/tmp/t_trc';
trace on;

update oper_table
set oper_id='001'
where oper_id='001';

--trace 'errno ' || errno;

return 10000;
end procedure;


when update statement execute sucess£¬ i cannot get the errno£¬
so HOW TO GET SQLCODE AFTER A STATEMENT SUCCESS EXECUTED£¡

Hi there,

you can give the below statement after update clause

select dbinfo('sqlca.sqlerrd2') from systables where tabid=1;

This sql statement will return you a count, that is number of rows that have got affected in the immediate previous insert or update statement.

Regards,

lloyd
Reply With Quote
  #3 (permalink)  
Old 09-29-03, 21:23
clark_x clark_x is offline
Registered User
 
Join Date: Sep 2003
Posts: 8
THANKS!
btw, WHY the sqlcode disappear when update is executed success?

in fact , i know you told me . I just want to know where is the sqlcode?
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