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
What is null indicator in cobol db2?
What types of tables are there in the db2 database?
What is a collection in db2?
What is the purpose of using commit?
What is the result of open cursor statement?
How do I copy a table in db2?
Explain in brief how does db2 determine what lock-size to use?
Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?
Which command is used to remove all rows from a table?
How to fetch the last row from the table in SQL (db2)?
What do you mean by rollback?
When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?
Define check constraint.
How can tablespace be moved to another dasd volume that is allocated for that tablespace?
What is the difference between using bind () and rebind () methods of naming class?