Results 1 to 3 of 3

Thread: SQL code

  1. #1
    Join Date
    Jan 2005
    Posts
    10

    Unanswered: 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) ?

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

  3. #3
    Join Date
    Jan 2005
    Posts
    10
    Thanks

Posting Permissions

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