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 > DB2 ROWID info

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-04, 10:46
rkmarthy rkmarthy is offline
Registered User
 
Join Date: Jan 2004
Location: USA
Posts: 6
DB2 ROWID info

Hi All,

I am involved in WMQI development. My task is to read and update a DB2 database. One of the fields type is BLOB.

I wish to know, anyone have an idea about DB2 ROWID. Will they be automatically created? How can I access them? Are they unique?

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 03:50
dr_suresh20 dr_suresh20 is offline
Registered User
 
Join Date: Sep 2003
Posts: 218
There is no equivalent to an Oracle ROWID in db2. You might want to use db2 IDENTITY property to get row number.

Alternate approach would be to use GENERATE_UNIQUE built-in function and store the unique data in a new column in the table. It would generate 13 bytes bit data (CHAR(13) FOR BIT DATA) that are unique across the system. The GENERATE_UNIQUE function is persistent across database reorganization and migrations. Below is an example of how it can be used in a insert statement. When it is used as the primary key.

INSERT INTO <tab_name> VALUES (GENERATE_UNIQUE(), ?, ?, ?)

Hope this helps.
Reply With Quote
  #3 (permalink)  
Old 01-14-04, 10:28
cchattoraj cchattoraj is offline
Registered User
 
Join Date: Mar 2003
Posts: 343
"There is no equivalent to an Oracle ROWID in db2. You might want to use db2 IDENTITY property to get row number." In my opinion, RIDs are the equivalent of oracle ROWIDs - they are inaccessible in db2, which is a different issue.
Reply With Quote
  #4 (permalink)  
Old 01-14-04, 12:35
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally posted by cchattoraj
"There is no equivalent to an Oracle ROWID in db2. You might want to use db2 IDENTITY property to get row number." In my opinion, RIDs are the equivalent of oracle ROWIDs - they are inaccessible in db2, which is a different issue.
There is a ROWID data type in DB2 for OS/390 that I think can be used pretty much like Oracle's ROWID.
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