Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2003
    Location
    India
    Posts
    6

    Unanswered: BEGIN ATOMIC block in SQLj

    Hi,
    I am trying to use a atomic block within a SQLj statment. But I am getting this error when I am running the bldsqlj command :

    //atomicStmt is the class name
    ------------------------------------------------------------------------
    D:\SQLJ>bldsqlj atomicStmt user pwd
    [ibm][db2][jcc][sqlj]
    [ibm][db2][jcc][sqlj] Begin Customization of Profile:
    [ibm][db2][jcc][sqlj] Profile name is: atomicStmt_SJProfile0
    [ibm][db2][jcc][sqlj] Error: unable to customize profile atomicStmt_SJProfile0
    ------------------------------------------------------------------------
    The code that I am trying to execute is:
    #sql {
    BEGIN ATOMIC DECLARE numrows INT DEFAULT 0;

    UPDATE db2inst2.staff
    SET salary = 33333
    WHERE ID < 100;

    GET DIAGNOSTICS numrows = ROW_COUNT;

    UPDATE db2inst2.staff
    SET salary = numrows
    WHERE ID = 10;
    END
    };

    I am working ob DB2v8.1 on AIX.
    Is it that BEGIN ATOMIC cannot be used in the #sql{} SQLj stmt or is there any other error?

    Thanks!!
    Last edited by SShetty; 12-09-03 at 01:07.

Posting Permissions

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