Practice Question and Answer
8Q: What is a cursor ? Why should it be used in DB2? 939 05b5cc7dbe4d2b41977751598
5b5cc7dbe4d2b41977751598- Show AnswerHide Answer
- Workspace
- SingleChoice
Answer :
Explanation :
Cursor is a programming device that allows the SELECT to find a set of rows but return them one at a time. Cursor should be used because the host language can deal with only one row at a time.
- Show AnswerHide Answer
- Workspace
- SingleChoice
Answer :
Explanation :
DeCLarations GENerator : used to create the host language copy books for the table definitions. Also creates the DECLARE table.
Q: EXPLAIN has output with MATCHCOLS = 0. What does it mean? 1808 05b5cc7dbe4d2b41977751596
5b5cc7dbe4d2b41977751596- Show AnswerHide Answer
- Workspace
- SingleChoice
Answer :
Explanation :
a nonmatching index scan if ACCESSTYPE = 1
Q: How does DB2 determine what lock- size to use? 941 05b5cc7dbe4d2b41977751595
5b5cc7dbe4d2b41977751595- Show AnswerHide Answer
- Workspace
- SingleChoice
Answer :
Explanation :
1. Based on the lock-size given while creating the table space 2. Programer can direct the DB2 what lock-size to use 3. If lock - size ANY is specified, DB2 usually chooses a lock-size of PAGE
Q: What is RUNSTATS? 1329 05b5cc7dbe4d2b41977751594
5b5cc7dbe4d2b41977751594- Show AnswerHide Answer
- Workspace
- SingleChoice
Answer :
Explanation :
A DB2 utility used to collect statistics about the data values in tables which can be used by the optimizer to decide the access path. It also collects statistics used for space management. These statistics are stored in DB2 catalog tables.
Q: How do you insert a record with a nullable column? 1744 05b5cc7dbe4d2b41977751593
5b5cc7dbe4d2b41977751593- Show AnswerHide Answer
- Workspace
- SingleChoice
Answer :
Explanation :
To insert a NULL, move -1 to the null indicator To insert a valid value, move 0 to the null indicator
Q: What is REORG? When it is used? 1843 05b5cc7dbe4d2b41977751592
5b5cc7dbe4d2b41977751592- Show AnswerHide Answer
- Workspace
- SingleChoice
Answer :
Explanation :
REORG reorganizes data on physical storage to reclutser rows, positioning overflowed rows in their proper sequence, to reclaim space, to restore free space. It is used after heavy updates, inserts and delete activity and after segments of a segmented tablespace have become fragmented.
Q: What is sqlcode -811? 2111 05b5cc7dbe4d2b41977751591
5b5cc7dbe4d2b41977751591- Show AnswerHide Answer
- Workspace
- SingleChoice
Answer :
Explanation :
SELECT statement has resulted in retrieval of more than one row.

