Solved

Oracle SQLPlus Autonumber

Posted on 2004-03-29
3
1,365 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 50 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
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…

710 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