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
How to create db2 table in mainframe?
Can we delete records from view?
What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?
What is temporal table in db2?
How does a cursor work?
How to rename a table in DB2 ?
What is the meaning concurrency in the db2 database?
What is db2 instance?
Explain the benefits you can get from mainframe connect?
How do I copy a table in db2?
What is the difference between dbm cfg and db cfg file in db2 ?
Which component is responsible for db2 startup and shutdown?
What is the cobol picture clause of the db2 data types date, time, timestamp?
What is a plan and package in db2?
How is a typical db2 batch pgm executed?