Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Problem with the data type
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-lReceived on Mon Nov 19 2007 - 10:10:21 CST
![]() |
![]() |