Monday, February 28, 2011

MCQ: Cursors

What does a COMMIT statement do to a CURSOR
A. Open the Cursor
B. Fetch the Cursor
C. Close the Cursor
D. None of the above
Answer: D

Is it possible to open a cursor which is in a Package in another procedure ?
A. True
B. False
Answer: A

Which of the following is not correct about Cursor ?
A. Cursor is a named Private SQL area
B. Cursor holds temporary results
C. Cursor is used for retrieving multiple rows
D. SQL uses implicit Cursors to retrieve rows
Answer: B

For reading through row by row,we use
A. Trigger
B. Stored procedure
C. cursor
D. Function
ANSWER: C

Which of the following is not a feature of a CURSOR FOR loop?
A. Record type declaration
B. Opening and parsing of SQL statements
C. Fetches records from cursor
D. Requires exit condition to be defined
ANSWER: D

Which line in the following statement will produce an error?
A. cursor action_cursor is
B. select name, rate, action
C. into action_record
D. from action_table;
ANSWER: C

Which of the following statements is true about implicit cursors?
A. Implicit cursors are used for SQL statements that are not named.
B. Developers should use implicit cursors with great care.
C. Implicit cursors are used in cursor for loops to handle data processing.
D. Implicit cursors are no longer a feature in Oracle.
ANSWER: A

The command used to open a CURSOR FOR loop is
A. open
B. fetch
C. parse
D. None, cursor for loops handle cursor opening implicitly.
ANSWER: D

After executing an UPDATE statement, the developer codes a PL/SQL block to perform an operation based on SQL%ROWCOUNT. What data is returned by the SQL%ROWCOUNT operation?
A. A Boolean value representing the success or failure of the update
B. A numeric value representing the number of rows updated
C. A VARCHAR2 value identifying the name of the table updated
D. A LONG value containing all data from the table
ANSWER: B







8 comments:

  1. I like reading an article that will make people think. Also, thank you for permitting me to comment!

    ReplyDelete