Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Storing GUIDs in Oracle

Re: Storing GUIDs in Oracle

From: Jim Kennedy <kennedy-down_with_spammers_at_no_spam.comcast.net>
Date: Thu, 24 Jul 2003 00:08:29 GMT
Message-ID: <1sFTa.116246$wk6.30579@rwcrnsc52.ops.asp.att.net>


Yes, you can use it as a primary key, but there are more efficient methods. (eg use a sequence and then at most the key will take up 22 bytes and most of the time much less than that) Why people want to use them for meaningless primary keys is a mystery to me, but yes it is possible. Jim

-- 
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"Jeff Boenig" <jeff.boenig_at_elsitech.com> wrote in message
news:3f1ed48a$1_at_btitelecom.net...

> I did check the SQL Reference and the only occurrence of GUID that I found
> (aside from alot of hits on the word Guide) is the documentation for the
> SYS_GUID() function. That answers the question of whether a GUID can be
> stored in the database. The other part of my question is whether you can
use
> it as a primary key. The documentation talks about RAW and LOB datatypes
> together and states that LOB columns cannot be used as primary keys and
> cannot be indexed. It doesn't say whether the same applies to RAW columns.
>
> I was also hoping to find out if anyone has tried this with the ADO.NET to
> see if it converts the column properly. I was also hoping to get some
> feedback from people who have used GUIDs as primary keys in Oracle
> databases, to find out what they thought of the technique.
>
> There isn't a straightforward answer to my questions in the SQL Reference.
I
> want to design my database to work equally well with MS-SQL and Oracle,
> which is why I thought posting these questions on this newsgroup would be
a
> constructive thing to do.
>
> The purpose of a newsgroup is exchange ideas and experience. That's what I
> was looking for and I think that my questions are relevant.
>
> If you didn't think my question was worthy of answer, you shouldn't have
> posted a response. I think you took the trouble to respond because you get
> some sort of weird satisfaction out of telling someone to RTFM. No, I
don't
> know as much about Oracle as you do. You're soooo smart. Maybe the hostile
> response had something to do with my mention of MS-SQL.
>
>
> "Maximus" <qweqwe_at_qwqwewq.com> wrote in message
> news:bzxTa.523341$Vi5.13452754_at_news1.calgary.shaw.ca...
> > "Jeff Boenig" <jeff.boenig_at_elsitech.com> wrote in message
> > news:3f1e9642$1_at_btitelecom.net...
> > > I'm developing a .NET application that will support both MS SQL Server
> and
> > > Oracle 9i and above. I want to use GUIDs as the primary key in several
> > > tables. MS SQL supports this nicely using the UNIQUEIDENTIFIER data
> type.
> > > The ADO.NET OleDb data provider automatically converts it to a
> > System.Guid.
> > >
> > > Is it possible to store GUIDs in Oracle databases? There doesn't
appear
> > to
> > > be a GUID data type in Oracle 9i. Could I store it as RAW(16)? If I
do,
> > > would I be able to create an index on that column? Does Oracle 10i
have
> > > support for GUID?
> >
> > Load the Oracle SQL reference into Adobe Acrobat, search for "GUID."
> >
> > Why are so many programmers completely useless at doing basic research?
> >
> > Yes I'm flaming you.
> >
> >
>
>
Received on Wed Jul 23 2003 - 19:08:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US