Home » SQL & PL/SQL » SQL & PL/SQL » auto number field (Oracle 10g)
auto number field [message #289781] Wed, 26 December 2007 02:24 Go to next message
ashraf_al_ani
Messages: 92
Registered: October 2007
Location: Iraq
Member
Dear All
How can I create a table that has a field and its type act as
("auto number")
I mean what is coressponding in oracle the auto number in sql server or access

best wishes
Re: auto number field [message #289787 is a reply to message #289781] Wed, 26 December 2007 02:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
There is no "auto number" field in Oracle.
You have to create a sequence to get the next number and maybe a trigger to auto fill the column with this number.
See How to Use Sequence Values section in SQL Reference.

Regards
Michel
Re: auto number field [message #289813 is a reply to message #289781] Wed, 26 December 2007 03:35 Go to previous messageGo to next message
ashraf_al_ani
Messages: 92
Registered: October 2007
Location: Iraq
Member
THANKS A LOT FOR YOUR REPLAY

BUT PLEASE CAN YOU EXPLAIN MORE IN DETAILS BECAUSE I DONT KNOW WHERE TO WRITE THE STATMENT TO MAKE THE FILED INCREMENTED

BEST WISHES
Re: auto number field [message #289849 is a reply to message #289813] Wed, 26 December 2007 04:53 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Don't post in capitals.

Did you read the links I posted?
And also

Application Developer's Guide - Fundamentals
Chapter 9 Coding Triggers

And this old but clear thread on AskTom: Equivalent of identity column (sql server 7.0) In oracle !

Regards
Michel
Previous Topic: Created function granted to scott but not working
Next Topic: Clarification regarding REGEXP functions
Goto Forum:
  


Current Time: Fri Feb 07 21:46:14 CST 2025