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: how to define a pseudo auto value column in oracle?

Re: how to define a pseudo auto value column in oracle?

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Wed, 09 Feb 2005 16:04:20 -0800
Message-ID: <1107993692.124848@yasure>


Robert Wehofer wrote:

> Hello there!
>
> One of the most hated features in Oracle are the intricated use of sequences
> to create valid IDs for a prim key column. In Access you've got the data
> type Autovalue, which is solid and simple. In Oracle you need to know the
> name of the sequence and have to call nextval, if you want to insert a
> dataset. Is there a way to automate the setting of the ID using sequences?
> One way is to use insert triggers, but is there a possibility to define a
> sequence as default value for a prim key value? If yes, how would be the
> syntax of the 'create table' statement? And is ADO able to return the data
> type Autovalue, if a column in Oracle has got a sequence as default value?
>
> Regards,
> Robert

Hated by who exactly? Joe Celko has made it more than clear in numerous communications that those "beloved" identity columns don't even belong in a relational database. And exactly what is it about typing: CREATE SEQUENCE x;
that is so hard on your fingers?

Or is it using the sequence in your insert statement that causes you so much pain?

INSERT INTO t VALUES (x.NEXTVAL);

Ouch ouch ... could someone please bring me a tourniquet for my carpal tunnel syndrome. Those 8 characters are abusive. Damn Larry and his minions.

This is Oracle. Embrace it. Autonumbering is dumber than dirt and I am grateful we don't have to deal, in Oracle, with its inevitable carnage.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Feb 09 2005 - 18:04:20 CST

Original text of this message

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