How can i keep sys_guid() unique in multiple table insert

15 pts.
Tags:
Oracle 9
Oracle SQL
I want to use unique sys_guid() for insert multiple table but out put are difference sys_guid() drop table T1; drop table T2; drop table T3; create table T1 (ROW_ID varchar2(50)); create table T2 (ROW_ID varchar2(50)); create table T3 (ROW_ID varchar2(50)); insert all into T1 values (NEW_ROW_ID) into T2 values (NEW_ROW_ID) into T3 values (NEW_ROW_ID) select sys_guid() as NEW_ROW_ID from dual; select * from t1 union all select * from t2 union all select * from t3; ROW_ID -------------------------------- CEFF10B45BFD3705E044002128808A0C CEFF10B45BFE3705E044002128808A0C CEFF10B45BFF3705E044002128808A0C

Software/Hardware used:
Oracle 9

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    SYS_GUID() was designed to generate a 'globally unique identifier', so when you use it in inserts or updates it is executed once for each row (see Oracle┬« Database SQL Language Reference 11g Release 1 (11.1)) - SYS_GUID). If you want to insert the same value into all 3 tables, you would probably need to do something like this: declare new_row_id varchar2(50); begin select sys_guid() into new_row_id from dual; insert all into t1 values (new_row_id) into t2 values (new_row_id) into t3 values (new_row_id) select new_row_id from dual; end; /  
    68,525 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following