If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > rowid ZOS 9 stored procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-17-07, 20:30
ASHOKJOSE ASHOKJOSE is offline
Registered User
 
Join Date: Jun 2007
Posts: 8
Question 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 20:45.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On