If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > syntax to set identity key in an existing column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-27-08, 22:59
janeprodriguez janeprodriguez is offline
Registered User
 
Join Date: Oct 2008
Posts: 11
Question syntax to set identity key in an existing column

hello everyone,

Im new with DB2, I need help in setting up an identity key into my existing column. can you give me the proper syntax on how to do it.

thanks.

Jane
Reply With Quote
  #2 (permalink)  
Old 10-28-08, 02:51
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I am not sure what you are trying to do, but please consult the SQL Reference Manual Vol 2, for ALTER TABLE.

Here is a link to the manuals, which lets you first select the version of DB2 you are using (DB2 for Linux, UNIX, Windows).
http://www-01.ibm.com/support/docvie...id=swg27009474
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 10-28-08, 03:59
janeprodriguez janeprodriguez is offline
Registered User
 
Join Date: Oct 2008
Posts: 11
Hi marcus thanks for replying. here is exactly what i want to do

I would want the identity to be set in master table
and in transaction tables i will refer this key as foreign key but i would not want to add a new column in my existing table what I want is to set the existing column in my table as the identity key
Reply With Quote
  #4 (permalink)  
Old 10-28-08, 08:09
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You should be able to do what you want. As Marcus stated, please review the ALTER TABLE SQL statement to perform what you want.

http://publib.boulder.ibm.com/infoce.../r0000888.html

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On