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 > how to print the temp variable in informix sql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Feb 2013
Posts: 2
how to print the temp variable in informix sql

Hallo everybody,

i am about to manage small DB, i want to make procedure that count the number of rows in a table , then i would like to print this value immediately .. the procedure is like :

create procedure testing()

define cnt integer;
select count(*) into cnt from temp_tbl;



end procedure;


execute procedure testing();

## the question is how to print cnt value? is there a way to see this value ,, like print cnt;


drop procedure testing();

it would be realy kind if some one give notice about the best solution

Cheers
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Mar 2012
Location: Somewhere In Europe
Posts: 24
Hi
Please try this:

create procedure testing() RETURNING INTEGER;

define cnt integer;
BEGIN
LET cnt =0;
select count(*) into cnt from temp_tbl;
RETURN cnt;

END
end procedure;

execute procedure testing();
drop procedure testing();

Regards
Mike
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Feb 2013
Posts: 2
Thanks so much

Many thank for your reply.. this has really helped..
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