• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1405
  • Last Modified:

Oracle SQLPlus Autonumber

Hello,

I'm using Oracle SQLPlus and I was wondering if there was any way of declaring a field as both a primary key and an autonumber??? I need to do this using ONLY SQL plus, not forms builder or anything else!

At the moment, the create table statement looks like:

create table customer
 (CUSTID number(4) not null primary key, ..........)

so can I turn CUSTID into an autonumber here?

Thanks
0
tigermoth
Asked:
tigermoth
  • 2
1 Solution
 
baonguyen1Commented:
No, you can not do that.  You have to create a sequence then specify it in the insert command or write a trigger insert the sequence every insert. There is no default autonumber option in create table command as you wish.

Hope this helps
0
 
tigermothAuthor Commented:
and if you fancy some more easy points, you can try helping me here:

http://www.experts-exchange.com/Databases/Q_20935831.html
0
 
tigermothAuthor Commented:
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now