View previous topic :: View next topic
|
Author |
Message |
Mudassir Ansari
New User
Joined: 06 Nov 2007 Posts: 16 Location: Hyderabad
|
|
|
|
Hi,
I have some questions which I am unable to find the answers.
1. To know the relation between the DB2 tables, which table is used?
2. Using _________function on an indexed column in predicate is not a good practice, as it lowers the query performance.
3. In “Selective SORT”, ___________ is analogous to WRITE.
Do let me know if any one knows the same. Thanks in advance.
Regards,
Mudassir Ansari. |
|
Back to top |
|
|
karthi_ind
Active User
Joined: 24 Feb 2004 Posts: 131 Location: Chennai
|
|
|
|
The answer for your first question is
Foreign Key
SELECT B.REFTBNAME AS PARENTTABLE,COLNAME
FROM
SYSIBM.SYSFOREIGNKEYS A,
SYSIBM.SYSRELS B
WHERE A.RELNAME = B.RELNAME
AND B.TBNAME = 'table name'
AND B.REFTBCREATOR = 'creator'
AND B.REFTBCREATOR = A.CREATOR
Above query will show the foreign key relation for the table mentioned in the query
Primary key
SELECT NAME
FROM
SYSIBM.SYSCOLUMNS
WHERE TBNAME = 'table name'
AND TBCREATOR = 'creator'
AND KEYSEQ > 0
ORDER BY KEYSEQ ASC
Above query will show the primary key relation for the table mentioned in the query.
I think this is what you are expecting. correct ? |
|
Back to top |
|
|
Mudassir Ansari
New User
Joined: 06 Nov 2007 Posts: 16 Location: Hyderabad
|
|
|
|
Probably the answer which I came to know is SYSIBM.SYSRELS where it defines the relationship between the DB2 table as in the question it was asking for a table name. |
|
Back to top |
|
|
Mudassir Ansari
New User
Joined: 06 Nov 2007 Posts: 16 Location: Hyderabad
|
|
|
|
I got the answers for second & third also.
2. Scalar.
3. Release. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
In “Selective SORT”, ___________ is analogous to WRITE. |
Who made up the term "selective sort"? RELEASE is analogous to WRITE when using an "Internal Sort".
The word selective is not in the entire current cobol manual. . . I have no idea where some interviewer came up sith this. . . |
|
Back to top |
|
|
|