Solved

Oracle SQLPlus Autonumber

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to SQL Trace a SPECIFIC query 24 84
SQL Server memory sizing - reallocation 16 78
SQLite with Mobile Development 4 26
Shrink multiple databases at once 4 30
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

820 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