ADVERTISEMENT
ADVERTISEMENT

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.

  1. SELECT
  2. DML
  3. Both A and B
  4. 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.


2. In SQL, a cursor facilitates naming ____ statements and manipulating the information within those statements.

  1. SELECT
  2. CREATE
  3. DELETE
  4. UPDATE

Answer: A) SELECT

Explanation:

In SQL, a cursor facilitates naming SELECT statements and manipulating the information within those statements.


3. Which of the following is present in the syntax of creating a cursor?

  1. CREATE
  2. IS
  3. Both A and B
  4. None of the above

Answer: C) Both A and B

Explanation:

CREATE and IS are both present in the syntax of creating a cursor.


4. The ____ statement is used after the cursor has been declared.

  1. Open
  2. Close
  3. Begin
  4. End

Answer: A) Open

Explanation:

The open statement is used after the cursor has been declared.


5. What is the syntax to open the cursor?

  1. OPEN cursor_name;
  2. CLOSE cursor_name;
  3. BEGIN cursor_name;
  4. END cursor_name;

Answer: A) OPEN cursor_name;

Explanation:

The syntax to open the cursor is OPEN cursor_name;


6. To fetch rows from a cursor, you use the ____ statement after declaring and opening the cursor.

  1. GET
  2. FETCH
  3. ADD
  4. INSERT

Answer: B) FETCH

Explanation:

To fetch rows from a cursor, you use the FETCH statement after declaring and opening the cursor.


7. Which of the following is present in the syntax of fetching the cursor?

  1. FETCH
  2. INTO
  3. Both A and B
  4. None of the above

Answer: C) Both A and B

Explanation:

FETCH and INTO are both present in the syntax of fetching the cursor.


8. What is the syntax to fetch the cursor?

  1. INTO cursor_name INTO variable_list;
  2. INTO cursor_name INTO variable_list;
  3. FETCH cursor_name FETCH variable_list;
  4. 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;.


9. What are the parameters in fetching the cursor?

  1. Cursor_name
  2. Variable_list
  3. Both A and B
  4. None of the above

Answer: C) Both A and B

Explanation:

The parameters in fetching the cursor are -

  1. Cursor_name
  2. Variable_list

10. By specifying the cursor_name, you can fetch ___ from the cursor.

  1. Rows
  2. Columns
  3. Attributes
  4. None

Answer: A) Rows

Explanation:

By specifying the cursor_name, you can fetch rows from the cursor.


11. The cursor result set is stored in ____ specified by variable_list.

  1. Constants
  2. Variables
  3. Lists
  4. None

Answer: B) Variables

Explanation:

The cursor result set is stored in variables specified by variable_list.


12. Which of the following is the final step in cursor function?

  1. CREATE
  2. FETCH
  3. CLOSE
  4. None

Answer: C) CLOSE

Explanation:

CLOSE statement is the final step in cursor function.


13. Once you have finished using the cursor, the ____ statement closes it.

  1. OPEN
  2. BEGIN
  3. END
  4. CLOSE

Answer: D) CLOSE

Explanation:

Once you have finished using the cursor, the CLOSE statement closes it.


14. What is the syntax to close a cursor?

  1. END cursor_name;
  2. DROP cursor_name;
  3. CLOSE cursor_name;
  4. None

Answer: C) CLOSE cursor_name;

Explanation:

Once you have finished using the cursor, the CLOSE statement closes it.


15. One can declare a ____ with a cursor.

  1. List
  2. Cursor
  3. Statement
  4. Array

Answer: B) Cursor

Explanation:

One can declare a cursor with a cursor.


16. As you retrieve a new record from the first cursor, you must continuously open and close the ____ cursor.

  1. First
  2. Second
  3. Third
  4. All

Answer: B) Second

Explanation:

As you retrieve a new record from the first cursor, you must continuously open and close the second cursor.



ADVERTISEMENT
ADVERTISEMENT


Comments and Discussions!



ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.