Tag: databases

Questions Related to databases

  1. Is used to obtain info about the previous executed sql statement

  2. Analyze the db2diag error messages

  3. Returns the user ID calling the stored proc

  4. Gives the access plan of the packages


Correct Option: A

CREATE PROCEDURE wise.Test123 (IN VAR1 INTEGER) P1: BEGIN DECLARE C1 CURSOR WITH RETURN TO CLIENT FOR SELECT DISTINCT NO FROM (VALUES (1),(2),(3),(3),(2)) AS TEST (NO); SET VAR1= VAR1 * VAR1 +VAR1; END P1@ What happens when you call wise.Test123 (10)

  1. Return Status = 0

  2. 3 rows returned by result-set

  3. 5 rows returned by result-set

  4. 110


Correct Option: A

Which of the following can be a user defined SQLSTATE

  1. 20000

  2. 35000

  3. 60000

  4. 71000


Correct Option: D

A Simple stored procedure is created with Dynamic Result sets 3 However only 2 cursors with return to client are defined within the source code. What will happen when you call the SP ?

  1. Will executes successfully

  2. Fails as limit is 3 but only 2 opened

  3. Executes with warning

  4. Would not allow compiling the SP at the first place


Correct Option: A
  1. CURRENT_CLIENT_ACCT

  2. CURRENT_SCHEMA

  3. CURRENT_DATETIME

  4. CURRENT_PARTITION


Correct Option: B

Which is not a valid data type in DB2 LUW?

  1. BIGINT

  2. DECFLOAT

  3. XML

  4. DATETIME


Correct Option: D