Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    8

    Unanswered: 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£¡

  2. #2
    Join Date
    Aug 2003
    Location
    India
    Posts
    262

    Re: Informix 723 Spl :how To Get Sqlcode?

    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

  3. #3
    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?

Posting Permissions

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