Tag: databases

Questions Related to databases

What is the purpose of the COLLECTION parameter of precompile/bind parameter

  1. define the name of the package

  2. provide an alias for the package

  3. define the schema of the package

  4. define the database of the package


Correct Option: C

Which type of cursor should be used so that its position will be maintained between transactions

  1. FOR HOLD

  2. FOR UPDATE

  3. FOR FETCH

  4. WITH HOLD


Correct Option: D

What is the function of DB2 pre-compiler

  1. Removes all the statements in source code

  2. Replaces all the SQL statements into corresponding host language CALL statements

  3. Replaces SQL statements into corresponding host language statements

  4. None of the above


Correct Option: B

AI Explanation

To answer this question, you need to understand the function of a DB2 pre-compiler. Let's go through each option to understand why it is correct or incorrect:

Option A) Removes all the statements in source code - This option is incorrect because the DB2 pre-compiler does not remove all the statements in the source code. Rather, it processes the source code and performs certain transformations.

Option B) Replaces all the SQL statements into corresponding host language CALL statements - This option is correct. The function of a DB2 pre-compiler is to process the source code and replace all the SQL statements with corresponding host language CALL statements. This allows the SQL statements to be executed by the DB2 database.

Option C) Replaces SQL statements into corresponding host language statements - This option is incorrect because the DB2 pre-compiler does not replace the SQL statements with corresponding host language statements. It specifically replaces them with CALL statements.

Option D) None of the above - This option is incorrect because option B is the correct answer. The DB2 pre-compiler does replace SQL statements with corresponding host language CALL statements.

The correct answer is B. This option is correct because the function of the DB2 pre-compiler is to replace all the SQL statements in the source code with corresponding host language CALL statements.

  1. BIND

  2. REBIND

  3. Both A & B

  4. None of the above


Correct Option: C

Which SQLCODE is used to check for duplicate index on a column

  1. -803

  2. -811

  3. -805

  4. -855


Correct Option: A

A Package is

  1. A single, bound DBRM

  2. A Multi bound DBRM with optimised access paths

  3. A Single bound DBRM with optimised access paths

  4. A Multi bound DBRM


Correct Option: C
  1. Edited form of the SQL statements with some additional information

  2. Complied version of SQL statements

  3. Complied version of source code

  4. None of the above


Correct Option: A

Which is the system that DB2 uses for locking

  1. LOCK Manager

  2. Resource Manager

  3. IRLM

  4. None of the above


Correct Option: C

A Plan

  1. Is an executable module containing access path logic provided by the DB2 optimiser

  2. In an non executable module containing access path logic provide by the DB2 optimiser

  3. Is just a module containing access path to DB2 optimiser

  4. Is a module containing access path


Correct Option: A
  1. It will drop the existing plan

  2. It will delete the existing plan

  3. Both a & b

  4. None of the above


Correct Option: C