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 > How to determine if column is auto id

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-09, 11:51
Yadrif Yadrif is offline
Registered User
 
Join Date: Sep 2008
Posts: 7
How to determine if column is auto id

Hi Everyone,
How do I determine if a column was created as

INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL?

I tried describe table with show detail but do not see anything indicating generated or identity in the output.

Seems like there must be a way.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 01-28-09, 12:16
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Look in the SYSCAT.COLUMNS catalog view.
Reply With Quote
  #3 (permalink)  
Old 01-28-09, 12:41
Yadrif Yadrif is offline
Registered User
 
Join Date: Sep 2008
Posts: 7
Thanks very much for your response.

Thanks.
Reply With Quote
  #4 (permalink)  
Old 01-28-09, 18:51
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You can also do a db2look.

db2look -d db-name -t table-name -e
__________________
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
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