How to know the primary key of a table without defining the
primary key in the table?
Answers were Sorted based on User's Feedback
Answer / kums
you could use SYSIBM.SYSINDEXES table to know more about
the table index.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / nkv
Use the table name in SYSINDEXES to get the Primary index
name. The Primary index will have the value āPā against
UNIQUERULE column in this table. Use this index name in
SYSKEYS table to get the column(s) in Primary key.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / priya shankar
If a column of the table uniquely defines each row in the
table then that column is called the Primary Key. Please
correct me if I am wrong.
| Is This Answer Correct ? | 9 Yes | 9 No |
Answer / 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 |
What is load utility in db2?
Write a query to retrive partial string.
What is coalesce in db2?
how can you copy records present in a flat physical file to a database file(physical file).please explain in rpg400 with a simple example
What is a db2 schema?
Why do we bind in db2?
what types of copies can be made with the COPY Utility ?
How we create a tables in db2,what is the process/syntax to create a table with example plz?
In a DB2-CICS program which is acts as co-ordinator and which is participant?
What is catalog database in db2?
What is alias in db2?
What is host variable?