0% found this document useful (0 votes)
202 views12 pages

Ans: Cursor Has Not Been Declared With Hold Option

1. The cursor will be closed after the last row of the fetch statement if the close of the cursor is not declared. 2. If a cursor is closed with a commit operation, it means the cursor was not declared with the HOLD option. 3. The query "select min(empcomm) from employee where empsal> 15000" will return -3000.

Uploaded by

abjanuary
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
202 views12 pages

Ans: Cursor Has Not Been Declared With Hold Option

1. The cursor will be closed after the last row of the fetch statement if the close of the cursor is not declared. 2. If a cursor is closed with a commit operation, it means the cursor was not declared with the HOLD option. 3. The query "select min(empcomm) from employee where empsal> 15000" will return -3000.

Uploaded by

abjanuary
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 12

1. What happens if the close of the cursor is not declared after a fetch statement ?

Ans: cursor will be closed after the last row of fetch 2. If a cursor is closed with consequence of a commit operation, what does it mean?

Ans: cursor has not been declared with hold option.

3. Consider the following employee table Empsal empcomm 20000 8000 12000 null 250000 6000 76000 23000 16000 null 28000 -3000 16500 0 What does the query select min(empcomm) from employee where empsal> 15000? Ans: -3000 4. How can a column can be checked for null using indicators? Ans: A negative number in the null indicator variable indicates that the column value is null

5. A cobol db2 program does not update any table Which of the following cursor declaration should be used for efficient performance? Ans: Declare statement should be done for read only.

6. Which of the following could lead to negative sql codes during the execution in a cobol db2 prog? (choose 3) Ans: Duplicate row getting inserted Dbrm and load module timestamps different More than one row returned for a query where cursor is not used.

7. In which of the following VARCHAR can be effectively used? Ans: Usage in static sql. 8. With which of the following dynamic sql can be prepared and executed? (CHOOSE 2) Ans: from online operation supplied by a terminal In an application program queries will be constructed during the time

9. What are the program options available on delete of a parent table entry whose primary key is foreign key in another child table?(choose 3) Ans: 1. Cascade 2. Set null 3. Restrict

10. How many use can a single vsam file support ? Ans: Single view 11.Which of the following does a precompiler panel allow you to select? (choose 3) Ans: 1. library containing the members that should be included 2. Input dataset name of source program and sql statement

3.Db2 table that needs to be handled 12. Queries that do an index scan perform better than those which does index seek are a table scan? State true or false Ans: True 13. A JCL can execute a db2 statement/program. State true or false Ans: True 14. Which of the following is valid regarding cursors in a cobol db2 prog? All the listed options 1. declare open close and fetch 2. More than one cursor can be opened in a prog 3. Cursor not mandatory it is based on requirement so a prog may not even have a single cursor 15. Check pending is set when RI constraints exist. Which of the following should occur for the check pending to be set? a. RECOVER TO COPY was specified B. LOAD ENFORCE NO was specified and RI constraints exist c. check data detects violation and delete yes was not specified d. ALTER table was specified to add foreign keys. e. all the list of options 16. In which of the following scanarios null indicator returns a positive value? (choose 2) A. column is not null but the value is truncated and an sql warning is issued B. column is not null 17. Consider the entry software which includes entities -> programming software, networking software and system software. Which of the following inheritance rule is applicable in a given scenario?

Ans: In addition to this own attributes the attributes of the entities programming software, networking software and system software also become the attributes of entity software 18. Which of the following LOCKSIZE parameter is suitable for segmented tablespace? Ans: Table 19. If you do the bind package what is the input that it takes? Ans: DBRM a. load module b. None of the listed options c. source prog d. object module 20. Which of the following are declarations are that need to be made in a db2 prog to use DSNTIAR? (Choose 3) a. Text message line in occurs clause b. ERROR MESSAGE AREA and total length of the message area in comp value c. declare WHENEVER clause before calling DSNTIAR d. logical record length of the output lines. e. declare the sql return codes that are to be handled by DSNTIAR

21. Consider the following: A table contains field 1, field2, field3, field4 Field2 is declared as not null. The insert statement does not include the field2, what happens under this situation? Ans: Insert will fail 22. The status of a tablespace after it has been REORGed using LOG NO is copy pending. State true and false Ans: True

23. What happens by executing the statements in declared section of an embedded sql application? a. dynamic sql will receive values b. global variables are declared c. Host variables are defined d. error libraries are added e. functions are declared 24. Primary key can have null values. State true or false Ans: FALSE 25. A plan needs to refer 4 packages insead only 3 packages are bound. Which of the following happens during prog execution? Ans: The plan bind will not be successful 26. COMMIT statement cause a point consistency during program exection. State true or false Ans: True 27. What happens if the close of a cursor is not declared after a fetch statement Cursor will be closed after the last row of fetch The same cursor cannot be opened during the execution of prog Program goes for abend None of the above

28. Database descriptor contains a. Mapping of the tablespaces, tables and indexes defined in a database b. Db2 table field values c. Db2 table structure d. Description of table fields 29. Which of the following statements are true? a. All the listed options

b. Web query simplifies and accelerates the report generation and management c. The browser interface, using the latest web 2.0 and ajax technologies enables point and click and drag and drop ease of use d. Web query allows quick access to data contained in db2 for I db via wizard style web interface. 30. Which of the following happens when LOCKSIZE IS ANY is specified and the application program crosses the limit of max no of rows are page level lock. a. LOCK ESCALATION process is handled by db2 b. The application prog goes for an abend c. Incorrect data retrieval happens d. The program stays in that position and goes for a deadlock 31. Under which of the following situation does the use of whenever clause for SQL warning works in db2? a. When the return code is positive but not +100 b. When the sql code is negative c. When the sql code is zero d. When the sql code is +100

32. STUDENTS S_ID NAMES SPEC 001 PRIYA A01 002 SIVA M01 003 RAVI M01 004 UMA C01 005 PAUL006 RAM S01 SPECIALIZATION

SPECNO SPEC_NAME A01 AGRICULTURE E01 ELECTRICAL M01 MECHANICAL S01 MBA S02 INDUSTRIAL C01 CIVIL The following queries issued on the above table Select name, spec_name from students s full outer join specialization z, where s.spec = z.spec no How many rows will be there in the result set on executing? Ans: 5 33. Which of the following can be dropped in db2? a. All the listed options b. Column c. View d. Table e. database 34. Include statement expanded during ____________ a. Pre compile time b. Compile time c. Bind time d. Run time 36.a column is declared as VARCHAR.a fixed length host is used to handle that column.what happens to trailing spaces upon insert or update? a)the spaces are not removed and the length becomes the declared length of host variable.

37. Which of the following implementation helps in continuing processing from the last successfully processed point within a given db2 pgm? a) checkpoint-restart logic (other options roll back mech., declaration of cursors, handling of deadlocks) 38. Which of the following authority should be available for CREATE TABLE to be successful? a. SYSADM B. CREATE TAB C. DBADM D. SYSCTRL 39. Apart from the WHERE clause, which of the following clause can use null? HAVING GROUP BY ORDER BY IN

40. If two indexes are of equal ranking in the WHERE clause, db2 will use the index of the column specified higher in the WHERE clause? State true or false. TRUE

41. For which of the following the VARCHAR function returns a varying length character string representation? All the listed options Date time value Character string Graphic string Integer or decimal number

42. Which of the following are part of infrastructure of db2?(choose 3) Db2 optimizer

Db2 Registry Db2 Storage Db2 Security Db2 Catalog tables

43. Which of the following are mandatory when declaring a cursor in db2 program using DECLARE statement? Select clause <name> cursor clause Where clause Update and no update clause

44. Which of the following is the correct syntax structure for embedded sql statement? 1. EXEC SQL <QUERY> END-EXEC 2. EXEC SQL <QUERY> END 3. EXEC SQL <QUERY> 4. END EXEC EXEC -SQL <QUERY> END-EXEC 45. In which of the following the cursor can be declared ? All the listed options Insert static sqls

Insert embedded sqls Inside dynamic sqls

46. If a table EMP has a column job Which of the following SQL statements will list jobs performed by 5 or more people? (choose 2) A. Select distinct job From EMPA Where 4 <(select count (*) from EMPB) Where ajob = bjob B. Select job from EMP Group by job Having count (*)>4 47. I we need to combine the result of 2 tables and fetch all rows frm them eliminating duplicates, which of the following needs to be used? Sub query Outer join Union all Union Inner join

48. SELECT EMPNO FROM DSN8710.EMP WHERE LAST NAME = HAAS UNION SELECT EMPNO FROM DSN8710.EMP WHERE JOB= PRES What is equivalent to about?

SELECT EMPNO FORM DSN8710.EMP WHERE LAST NAME = HAAS OR JOB = PRES 49. How can a column be checked for NULL using null indicators? a. When the null indicator variable has zero then the column value is understood as NULL b. if the null indicator variable has space then the column value is understood as NULL c. Null indicators can store the value but cannot be checkexd d. A negative number in the null indicator variable

50. Consider the following EMPLOYEE table:

EMPSAL EMPCOMM 200000 8000 12000 25000 NULL 6000

76000 23000 16000 NULL 28000-3000 16500 0 What does the query SELECT MIN(EMPCOM) FROM EMPLOYEE WHERE EMPSAL > 15000? a. None of the listed option b. 3000

c. -3000 * d. 0 51. Which of the following clause enables data to be sorted in a specified order of a column? Ans: Order by

You might also like