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: Autonumber facility? Beginner question...

Re: Autonumber facility? Beginner question...

From: Bryan Fritchie <bryan_at_latent.com>
Date: Thu, 24 Feb 2000 13:56:25 GMT
Message-ID: <dMat4.114$7c2.3538@newsread2.prod.itd.earthlink.net>


I am totally new to trying to do the DBA side of things, but since the person who did that is no longer with us, I am doing it at least on a temporary basis.

Can someone please show me how to set this up properly? As an example:

CREATE TABLE test (

ID         number PRIMARY KEY,
name     varchar2(25),
ID2       rowid

);

Then what? Here is a sample that I found somewhere, but can't get it to work.........

CREATE SEQUENCE test.id increment by 1 start with 1;

Also, what is the ROWID datatype? Should I be using that instead?


Lastly, I also found a piece of code that looks like:

ALTER TABLE test ADD CONSTRAINT PCR_P_ROWID_UK UNIQUE(ID2);

What does that do?


Like I said, this is not my normal job function, so please be clear, and give samples if possible. THANKS!!!!!!!

Bryan
bryan_at_latent.com

"Fritz" <fritz_nospam_at_mail4u.nl> wrote in message news:879hs9$hof$1_at_news1.xs4all.nl...
> You can try to solve it using a sequence and a 'before-insert-row'
trigger.
>
> h.t.h.
>
>
> Robert Blomstrand wrote in message <389847b6$0$35287_at_helios.is.co.za>...
> >Please help someone with very little Oracle experience...
> >
> >I need to know if there is a facility similar to the Access "Autonumber"
> >facility (please don't laugh at the reference to Access. I know you
cannot
> >compare it to Oracle).
> >
> >In Access you can allocate an Autonumber field in a table which will act
as
> >your primary key, and an incremented number will automatically be
allocated
> >to this field with each new row added to the table.
> >
> >If no such facility is available in Oracle, could someone please tell me
> how
> >to do this via a trigger.
> >
> >This greenhorn would appreciate any advice he can get :^)
> >
> >Please copy any response to rbl_at_qmedia.co.za as well as the newsgroup.
> >
> >Many thanks.
> >
> >
> >
>
>
>
Received on Thu Feb 24 2000 - 07:56:25 CST

Original text of this message

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