Results 1 to 3 of 3
  1. #1
    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

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

  3. #3
    Join Date
    Feb 2013
    Posts
    2

    Thanks so much

    Many thank for your reply.. this has really helped..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •