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: RAW(16) as Primary Key

Re: RAW(16) as Primary Key

From: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Fri, 06 Sep 2002 09:27:31 +0200
Message-ID: <6ulgnukosk11ktsgglkmk0monenh3rgpd4@4ax.com>

On 5 Sep 2002 22:23:52 -0700, hess2203_at_hotmail.com (M) wrote:

>Hi
>
>We are building a distributed application which will allow users to
>enter data offline and then later syncronize that data against the
>main database.
>Because we cannot use sequences when we are not connected to oracle,
>we found that using GUIDS may prevent key conflicts.
>We are planning to use RAW(16) columns to store the GUIDs in Oracle.
>The GUIDs will be the Primary Key of many of our tables.
>
>Are there any known disadvantages of using RAW(16) columns as primary
>keys and as foreign keys?
>
>Regards
>Matthias

Sure, you are on the way to hell. I am administering one 3rd app, which has been using the same setup, and the app is using full table scans almost *everywhere*
The problem is that a RAW(16) is recognized as a datatype by PL/SQL and OCI *ONLY*. In all other cases, if you don't use where ... PK_COLUMN = HEXTORAW(<varchar2 expression> you will end up with an implicit
RAWTOHEX(PK_COLUMN) = <varchar2 expression> which disables the indexes.
I would urge you STRONGLY to reconsider, and use it only (if you are planning to sell your app) if you have a really good lawyer.

Regards

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Fri Sep 06 2002 - 02:27:31 CDT

Original text of this message

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