Practice Question and Answer

Q: What is a cursor ? Why should it be used in DB2? 939 0

  • Show AnswerHide Answer
  • Workspace

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.

Q: What is DCLGEN? 1639 0

  • Show AnswerHide Answer
  • Workspace

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 0

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

a nonmatching index scan if ACCESSTYPE = 1

Q: How does DB2 determine what lock- size to use? 941 0

  • Show AnswerHide Answer
  • Workspace

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 0

  • Show AnswerHide Answer
  • Workspace

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 0

  • Show AnswerHide Answer
  • Workspace

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 0

  • Show AnswerHide Answer
  • Workspace

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 0

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

SELECT statement has resulted in retrieval of more than one row.

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully