I'm currently trying to understand how to generate Unique ID in SQL like HID0014. I can't seem to find any resources or documentation to help with this problem except answer in:
How to automatically generate unique id in SQL like UID12345678?
CREATE TABLE dbo.tblUsers
(
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
UserID AS 'UID' + RIGHT('00000000' + CAST(ID AS VARCHAR(8)), 8) PERSISTED,
[Name] VARCHAR(50) NOT NULL,
)
I have tried using it in my Oracle 19c SQL plus to generate a table but I am getting errors. Can someone explain if I am using the wrong syntax? Or the code provided above is invalid for Oracle 19c.