How to know the primary key of a table without defining the
primary key in the table?
Answer Posted / mani
Execute:
SELECT TBCREATOR, TBNAME, NAME, KEYSEQ
FROM SYSIBM.SYSCOLUMNS
WHERE TBCREATOR = 'creater id'
AND TBNAME = 'table-name'
AND KEYSEQ > 0
ORDER BY KEYSEQ
a nonzero value for KEYSEQ indicates the place of a column in
the primary key.
Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Is db2 a mainframe database?
What are the different types of base tables?
Which component is responsible for db2 startup and shutdown?
What is the max length of sqlca?
Why do chiropractors use drop table?
How would the varchar column remarks defined?
What is with ur in db2?
How connect db2 database to datastage?
What are bind parameters in db2?
How to create backup table in db2?
What are iseries servers?
Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?
What is db2 connect?
Why select is not preferred in embedded sql programs?
What is the difference between cursor and select statement?