Home »
MCQs »
Oracle MCQs
Oracle Cursor MCQs
Oracle Cursor MCQs: This section contains multiple-choice questions and answers on Cursor in Oracle.
Submitted by Anushree Goswami, on June 13, 2022
1. ____ statements such as INSERT, UPDATE, DELETE or MERGE are processed with the use of cursors.
- SELECT
- DML
- Both A and B
- None of the above
Answer: C) Both A and B
Explanation:
SELECT or DML statements such as INSERT, UPDATE, DELETE or MERGE are processed with the use of cursors.
Discuss this Question
2. In SQL, a cursor facilitates naming ____ statements and manipulating the information within those statements.
- SELECT
- CREATE
- DELETE
- UPDATE
Answer: A) SELECT
Explanation:
In SQL, a cursor facilitates naming SELECT statements and manipulating the information within those statements.
Discuss this Question
3. Which of the following is present in the syntax of creating a cursor?
- CREATE
- IS
- Both A and B
- None of the above
Answer: C) Both A and B
Explanation:
CREATE and IS are both present in the syntax of creating a cursor.
Discuss this Question
4. The ____ statement is used after the cursor has been declared.
- Open
- Close
- Begin
- End
Answer: A) Open
Explanation:
The open statement is used after the cursor has been declared.
Discuss this Question
5. What is the syntax to open the cursor?
- OPEN cursor_name;
- CLOSE cursor_name;
- BEGIN cursor_name;
- END cursor_name;
Answer: A) OPEN cursor_name;
Explanation:
The syntax to open the cursor is OPEN cursor_name;
Discuss this Question
6. To fetch rows from a cursor, you use the ____ statement after declaring and opening the cursor.
- GET
- FETCH
- ADD
- INSERT
Answer: B) FETCH
Explanation:
To fetch rows from a cursor, you use the FETCH statement after declaring and opening the cursor.
Discuss this Question
7. Which of the following is present in the syntax of fetching the cursor?
- FETCH
- INTO
- Both A and B
- None of the above
Answer: C) Both A and B
Explanation:
FETCH and INTO are both present in the syntax of fetching the cursor.
Discuss this Question
8. What is the syntax to fetch the cursor?
- INTO cursor_name INTO variable_list;
- INTO cursor_name INTO variable_list;
- FETCH cursor_name FETCH variable_list;
- FETCH cursor_name INTO variable_list;
Answer: D) FETCH cursor_name INTO variable_list;
Explanation:
The syntax to fetch the cursor is FETCH cursor_name INTO variable_list;.
Discuss this Question
9. What are the parameters in fetching the cursor?
- Cursor_name
- Variable_list
- Both A and B
- None of the above
Answer: C) Both A and B
Explanation:
The parameters in fetching the cursor are -
- Cursor_name
- Variable_list
Discuss this Question
10. By specifying the cursor_name, you can fetch ___ from the cursor.
- Rows
- Columns
- Attributes
- None
Answer: A) Rows
Explanation:
By specifying the cursor_name, you can fetch rows from the cursor.
Discuss this Question
11. The cursor result set is stored in ____ specified by variable_list.
- Constants
- Variables
- Lists
- None
Answer: B) Variables
Explanation:
The cursor result set is stored in variables specified by variable_list.
Discuss this Question
12. Which of the following is the final step in cursor function?
- CREATE
- FETCH
- CLOSE
- None
Answer: C) CLOSE
Explanation:
CLOSE statement is the final step in cursor function.
Discuss this Question
13. Once you have finished using the cursor, the ____ statement closes it.
- OPEN
- BEGIN
- END
- CLOSE
Answer: D) CLOSE
Explanation:
Once you have finished using the cursor, the CLOSE statement closes it.
Discuss this Question
14. What is the syntax to close a cursor?
- END cursor_name;
- DROP cursor_name;
- CLOSE cursor_name;
- None
Answer: C) CLOSE cursor_name;
Explanation:
Once you have finished using the cursor, the CLOSE statement closes it.
Discuss this Question
15. One can declare a ____ with a cursor.
- List
- Cursor
- Statement
- Array
Answer: B) Cursor
Explanation:
One can declare a cursor with a cursor.
Discuss this Question
16. As you retrieve a new record from the first cursor, you must continuously open and close the ____ cursor.
- First
- Second
- Third
- All
Answer: B) Second
Explanation:
As you retrieve a new record from the first cursor, you must continuously open and close the second cursor.
Discuss this Question