Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SYS_GUID()

M1k3GNov 24 2010 — edited Nov 25 2010
Hi. I am inserting a unique identifier sys_guid() using a trigger. I am populating 4 different columns, and each insertion will have 3 rows. The first column will have the product name. The second column will have a product category. The third column will have a unique identifier which is common to all 3 rows to tie them all together , and the fourth column will have a unique id for each row. It will look something as follows:
Product Name    Category   Product ID                                             Category ID
Air Conditioner   Seal         A6FA43B2320149AF9C2C532407670708    248B1BACA7784E6099929888CE5402B1
Air Conditioner   Valve       A6FA43B2320149AF9C2C532407670708     0ACAD5A5610348C2A1B486EF55326F36
Air Conditioner   Gasket     A6FA43B2320149AF9C2C532407670708     7ACFGTRFD610FHGC2A1B486EF55326F3
The insertion on the trigger will be something like this:
  INSERT INTO DANAOS.kapa_supply_items
        (ProdName,
         Category,
         ReqID,
         ReqItem)
      
      VALUES
        (:NEW.PROD_NAME,
         :NEW.PROD_CATEGORY,
         ?????
         sys_guid())
The question is how can I ensure that although I generate a unique code for the ReqID, it remains identical for all 3 lines.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2010
Added on Nov 24 2010
12 comments
1,704 views