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: Access to Oracle: Converting Autonumber fields

Re: Access to Oracle: Converting Autonumber fields

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Mon, 17 Jan 2005 21:04:32 -0800
Message-ID: <41ec98d4$1_1@127.0.0.1>


michaelgooding_at_yahoo.co.uk wrote:

> The Oracle-recommended method for converting autonumber fields seems to
> be to use an Oracle Sequence and Trigger, which seems a bit cumbersome;
> is there no alternative ?
>
> Mike Gooding
> ------------

Not only is it not cumbersome it is ridiculously simple.

CREATE SEQUENCE mysequence;

That sure took a lot of work

INSERT INTO mytable
VALUES
(mysequence.NEXTVAL);

Ouch ... my fingers are hurting. Can someone open the bottle of scotch and pour me two fingers ... please? Thanks.

<SORRY TO BE HARSH BUT>
Nothing good happens without some effort. If the above is too much for you then you should find another occupation. </SORRY TO BE HARSH BUT>

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Mon Jan 17 2005 - 23:04:32 CST

Original text of this message

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