Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    14

    Unanswered: @@transtate from Sybase to DB2

    Hi all,

    I'm converting a Sybase 12.5 stored procedure to DB2 v8.1. Inside it, there is a value @@transtate. Below is the definition quoted from Sybase Reference Guide:

    @@transtate - Contains the state of the current transaction in the current session. Possible values are: 0 - transaction in progress; 1 - transaction committed; 2 - previous statement aborted; transaction still in progress; 3 - transaction aborted and rolled back.


    Below is quoted from my sybase stored procedure:

    ....

    if @@transtate = 3 /*.... transaction abort */
    begin
    ....


    Can anyone suggest what functions in DB2 can represent @@transtate? Many thx.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: @@transtate from Sybase to DB2

    I'm not sure how much this will help you ...


    I think the closest thing in DB2 will be something like :

    DECLARE not_found CONDITION FOR SQLSTATE '02000';

    DECLARE CONTINUE HANDLER FOR not_found
    SET at_end = 1;


    You need to read the documentation for further details


    Cheers

    Sathyaram
    Originally posted by db2worker
    Hi all,

    I'm converting a Sybase 12.5 stored procedure to DB2 v8.1. Inside it, there is a value @@transtate. Below is the definition quoted from Sybase Reference Guide:

    @@transtate - Contains the state of the current transaction in the current session. Possible values are: 0 - transaction in progress; 1 - transaction committed; 2 - previous statement aborted; transaction still in progress; 3 - transaction aborted and rolled back.


    Below is quoted from my sybase stored procedure:

    ....

    if @@transtate = 3 /*.... transaction abort */
    begin
    ....


    Can anyone suggest what functions in DB2 can represent @@transtate? Many thx.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jul 2003
    Posts
    14
    Thx Sathyaram.

    I'm asking IBM consultant about this. Will post the solution here once I got it.

    Anyway, thx again!

Posting Permissions

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