Vous êtes sur la page 1sur 3

1) Which one best describes why cursor is used? a.

Cursors are used to access set-level data one row at a time. b. Scroll and update are done together. c. Multiple rows are updated at one time.
Quote: Ans:a

2) Which one is true for COMMIT? a. COMMIT always closes cursor. b. Close cursor does an implicit COMMIT. c. COMMIT Doesn?t close the cursor defined as WITH HOLD. d. Both B and C are correct.
Quote: Ans:d

3) What must be used to retrieve parts of the rows of a table? a. Column b. View c. Cursor d. *
Quote: Ans: (a - columns), we can achieve thru views also

4) Which is the most efficient way for specifying the table?s owner name in a cobol program? a. Use a variable to store the owner name and use it in the SQL b. Define it in the Plan and not in the program. c. Hardcode the name in the SQL.
Quote: Ans : b

5) Which is the most efficient way to handle large no. of rows in CICS through cursor? a. Use the cursor and store in indexed seq. file b. Use TSQ. c. Make query once and use the result in conversational program. d. Use the array inside the program.
Quote: Ans: If number of rows are too large, b and c may not be the right option.

6) Which term is used to mean hardcoding of SQL in Cobol? a. Dynamic SQL b. Embedded SQL c. Structured Programming. d. None of the above.
Quote: Ans:b

7) Which is the correct SQL? a. Select Sales-id, salary+commission as ?Compensation?order by Compensation b. Select Sales-id, salary+commission as Compensation order by Compensation c. Select Sales-id, salary+commission as ?Compensation?order by 2 d. Select Sales-id, salary+commission as Compensation order by 2 e. All of the above.
Quote: Ans: d

What does the DB2 precompiler do? a. Accesses the DB2. b. Invoked through DB2I. c. Expands the SQL. d. Creates load modules.
Quote: Ans:c

9) Home phone is a varchar and contains Null. What will happen when home phone is selected? a. Home-phone contains zeros and null-ind <0 b. Home phone contains garbage and null-ind <0. c. Home-phone value is unchanged and null-ind <0. d. None of the above.
Quote: Ans: b

11) What is true for group by,order by clause? a. Selected columns must be in the group by. b. Columns in group by must be selected. c. Selected columns must be column functions. d. Selected columns must be column functions or in the group by clause.
Quote: Ans:d

12) What is the way of using a Variable table name in the program? a. Use dynamic SQL. b. Put the variable name in EXEC SQL include statement. c. Define the variable as a host variable as type varchar. d. Replace the table name with ??? e. Use SPUFI
Quote: Ans: a

13) Best way to enforce referential integrity? a. Programmatically. b. Referential constraints on the create table declaration. c. No null clauses on the insert or update. d. Views in stead of the table. e. Using the distinct clause on all the select statements.
Quote: Ans: b

Vous aimerez peut-être aussi