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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Problem with the data type

Re: Problem with the data type

From: Don Seiler <don_at_seiler.us>
Date: Mon, 19 Nov 2007 10:10:21 -0600
Message-ID: <716f7a630711190810w1fa83102pdacffa7f0644876@mail.gmail.com>


The "best practice" is to use a NUMBER datatype for the ID field, and a sequence for the incrementing. Then when you do inserts you can directly call my_sequence.nextval.

See the example labelled "Simple Autonumber With Sequence" from http://www.psoug.org/reference/sequences.html

Don.

On Nov 19, 2007 1:32 AM, Shwe Yee Than <shweyeesyt_at_yahoo.com> wrote:
> Hi,
>
> I'm using oracle 10g in Linux OS. What data type can I use if I want the
> table to automatically increase the id (the primary key) of the table when I
> insert the values into the table?
> For example, we use "serial" data type in postgres database system.
>
> Can anyone help me? Thanks in advance.
>
> Regards,
> Shwe
>
>
> ________________________________
> Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.

-- 
Don Seiler
http://seilerwerks.wordpress.com
ultimate: http://www.mufc.us
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Nov 19 2007 - 10:10:21 CST

Original text of this message

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