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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Server Maintained Unique Index

Re: Server Maintained Unique Index

From: QuestionExchange <USENET_at_questionexchange.com>
Date: 3 Nov 1999 18:57:31 GMT
Message-ID: <2370qx@questionexchange.com>


> First of all please excuse my ignorance for what I believe is
a trivial
> Oracle problem but I scanned several sources without much
luck...
>
> I have an application currently running on MS SQL Server that
has several
> tables with an IDENTITY column. The column is a server
maintained, unique
> identifier on the table.
>
> I would like to create the same functionality in Oracle but
am unsure of the
> required syntax. So far I have got as far as creating a
sequence but wasn't
> sure how to script the trigger.
>
> BTW. I only need a unique column on the table for integrity
reasons. I
> want the column to be looked after by the server and don't
actually care
> what the values are.
>
> Could anyone please help (especially if there is an easier
way of doing
> this!!!)

Scripting a trigger isn't the easiest way of doing this, IMHO. The easiest way is to alter any insert statements to include SEQUENCE.NEXTVAL as the value for your identity column. In SQL*Loader, there are options to do this automagically when you bulk load data.
Hope that helps,
Doug.

--
  This answer is courtesy of QuestionExchange.com   http://www.questionexchange.com/showUsenetGuest.jhtml?ans_id=7008&cus_id=USENET&qtn_id=6902 Received on Wed Nov 03 1999 - 12:57:31 CST

Original text of this message

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