Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Oracle SQLPlus Autonumber

Posted on 2004-03-29
3
Medium Priority
?
1,384 Views
Last Modified: 2010-07-27
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
Comment
Question by:tigermoth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
baonguyen1 earned 200 total points
ID: 10703743
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
 

Author Comment

by:tigermoth
ID: 10703999
and if you fancy some more easy points, you can try helping me here:

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

Author Comment

by:tigermoth
ID: 10704045
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
What we learned in Webroot's webinar on multi-vector protection.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question