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 |
When one binds a PACKAGE ( of a plan ) what package information is stored and where it is stored?
What does the sqlcode of -818 pertain to?
Where are plans stored?
how to resolve -805 . how to see dbrm and package not found
In a Cobol-DB2 program, I am fetching rows from 4 tables using cursor and then based on the a field present in that table, It processes the information accordingly..for example stat-c is one digit field..if stat-c is 'D' then the a row is deleted from table and written those details in to a file. If the stat-c is 'U' then a row is updated (hardcoded what to update)in a table and written those details in to a file. If the stat-c is 'I' then a row is inserted in a table and written those details in to two files. The issue is i have to include the intermediate commits. When an abend occurs, due to commit statement db2 tables will be saved, But there will be lose of file contents. When we resubmitting the job associated with this program there will be insert ,update and delete anomolies to avoid that what measures could be taken?. The intermediate commit is nothing but issuing commit after massive inserts, updates and deletes(sum of 500actions)
Mention a credible reason why select* is never given preference in an sql program that has been embedded.
What is a synonym ?
how many partitions are possible in partitioned tablespace? dont say 1-64. a)240 b)256 c)512 d)none
What does DML stand for and what are some examples of it?
I have a main program (A) where we delete some rows in table in a cursor, and we commit it in sub program(B). What will happen - will we get an error or not?
How to find the maximum value in a column in the db2 database?
Explain about open switch business continuity software?