question

Ian Ringrose avatar image
Ian Ringrose asked

How do you store a GUID in an Oracle database?

It is easy to store a GUID in a SQL Server database, but how do you store one in an Oracle Database?

What are the pros and cons of each option?

What effect do they have on your usage of Ado.net?

What effect do they have on data DataSets that have GUID columns?

guid
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Jonah H. Harris avatar image
Jonah H. Harris answered

Unfortunately, Oracle does not provide a native UUID data type. As such, you'll often see RAW(16) or VARCHAR2 used to store GUID/UUID data. As for using it from ADO, I've never had a problem.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ian Ringrose avatar image Ian Ringrose commented ·
I have found in the past that ADO will not automaticity convert GUID columns in a dataset to/from RAW(16) or VARCHAR2 columns in a oracle database.
0 Likes 0 ·
Jonah H. Harris avatar image Jonah H. Harris commented ·
Ian, you are correct, I had to do the conversion. While I haven't used it in awhile, I don't believe there is any automatic conversion.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.