Results 1 to 4 of 4

Thread: DB2 ROWID info

  1. #1
    Join Date
    Jan 2004
    Location
    USA
    Posts
    6

    Unanswered: 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.

  2. #2
    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.

  3. #3
    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.

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

Posting Permissions

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