Reputation:
select (SELECT UPPER(SUBSTR(SYS_GUID(), 1, 16)) FROM DUAL) AS N_EVTtt_ID
from testing
I am using the above query to generate the unique ID(GUID) which apparently is giving me the same value for my primary key N_EVTtt_ID . Please advice how to fix this? The output for the above SQL query. I want all the IDs to be different.
AC87290F7D305666
AC87290F7D305666
AC87290F7D305666
AC87290F7D305666
AC87290F7D305666
AC87290F7D305666
Thanks in Advance
Upvotes: 0
Views: 2903
Reputation: 44766
Skip the subquery:
select UPPER(SUBSTR(SYS_GUID(), 1, 16)) AS N_EVTtt_ID
from testing
In an INSERT
:
insert into some_table
select UPPER(SUBSTR(SYS_GUID(), 1, 16)) AS N_EVTtt_ID from testing
Upvotes: 1