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: The Oracle sequence and table problem!

Re: The Oracle sequence and table problem!

From: Howard J. Rogers <howardjr_at_www.com>
Date: Mon, 5 Nov 2001 19:31:24 +1100
Message-ID: <3be64e48$0$21956$afc38c87@news.optusnet.com.au>


See my website, tips, administration. Look under Tables. The second article is all about "is there an autonumber feature in Oracle".

Regards
HJR

--

Oracle Resources : http://www.hjrdba.com
=============================


"Mark Liao" <markl_at_symtrontech.com> wrote in message
news:9s4rsn$69f$1_at_news.is.net.tw...

> Dear All,
>
> I have a question about the Oracle sequence and I hope somebody can show
me
> the answer.
>
> Currently, I use the Oracle 9i be the database server for my project. With
> the MS-SQL experience, I found that Oracle doesn't support the datatype
> which will generate the serial number automatically. It support the object
> called "Sequence" to generate the serial number. Then the question coming.
>
> Assume I have a table called "User_List". It includes 2 fields --
"User_ID"
> and " User_Name". I want the database server generate the "User_ID"
> automatically, and I just need to fill the "User_Name". In the MS-SQL, I
can
> do this without any problem. In the Oracle, I have to do such like:
>
> SQL statement --
>
> INSERT INTO User_List VALUES(Sequence.NEXTVAL , 'Mark');
>
>
> It is fine. However, my program uses ADO to add the data into the table,
not
> the SQL statement. I need the database server can generate the serial
number
> and fill into the filed automatically while my program inserts one record
> into the table. So, I want to know is it possible that I can setup the
> relationship between the "Sequence" and "Table/Filed" to finish this
work.
> Or, I need to do such like create "Trigger" or something else. If anyone
> know the answer, please let me know. Thank you so much.
>
>
>
> Mark Liao ^^*
>
>
Received on Mon Nov 05 2001 - 02:31:24 CST

Original text of this message

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