×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hi Ashish,
You could use the RowId or Identity while creating the Table.  You could
also do the alter table.

Create table myTable 
(RECORDID ROWID  NOT NULL <GENERATED ALWAYS>/<GENERATED BY DEFAULT>)

Create table MyTable 
(AutoNo <data type> <GENERATED ALWAYS>/<GENERATED BY DEFAULT> AS
IDENTTITY
START WITH - Optional 
INCREMENT BY - Optional )


Thanks,
Sudha

Sudha Ramanujan
SunGard Futures Systems
sramanujan@xxxxxxxxxxxxxxxxxx
(312) 577 6179
(312) 577 6101 - Fax

-----Original Message-----
From: Ashish Kulkarni [mailto:kulkarni_ash1312@xxxxxxxxx] 
Sent: Monday, May 02, 2005 12:21 PM
To: java400-l@xxxxxxxxxxxx
Subject: primary key to generate unique incremental number in DB2

Hi
is it possible to define while creating a table to
have a unique incrementing number for primary key
for example, suppose i have when i enter first record
the primary key will be 1, then it will increment by 1

Ashish

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.