Results 1 to 1 of 1
  1. #1
    Join Date
    Jun 2007
    Posts
    8

    Question Unanswered: rowid ZOS 9 stored procedure

    Hello,

    Given below are some steps, which I think should work on a ZOS9 but does not seem to work

    1) db2 create table tab1(col1 ROWID GENERATED ALWAYS NOT NULL, col2 int not null primary key)
    DB20000I The SQL command completed successfully.

    2) db2 CREATE PROCEDURE dd01(OUT res1 int)LANGUAGE SQL READS SQL DATA select col2 into res1 from tab1 where col2=1
    DB20000I The SQL command completed successfully.

    3) db2 CREATE PROCEDURE dd02(OUT res2 rowid)LANGUAGE SQL READS SQL DATA select col1 into res1 from tab1 where col2=1

    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL20060N The key transform table function used by the index extension of index "ROWID" of table "PARAMETER" in "RES2" generated duplicate rows. SQLSTATE=560AB

    4) db2 CREATE PROCEDURE dd02(OUT res2 rowid) LANGUAGE SQL READS SQL DATA select col1 into res1 from tab1 where col1=rowid(x'50A71F40CC30356A81C201B1D548010000000 0000201')

    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
    SQL20060N The key transform table function used by the index extension of
    index "ROWID" of table "PARAMETER" in "RES2" generated duplicate rows.
    SQLSTATE=560AB


    My question is why is statements 3 and 4 not working ?
    Can someone help me here if possible,
    This looks like some kind of limitation with the DB2 ?
    I am able to get the results into cursor but that does not serve my purpose. I basically want a out rowid.
    How do I get a output parameter for a rowid ?

    Ashok
    Last edited by ASHOKJOSE; 06-17-07 at 21:45.

Posting Permissions

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