Bird
0
0

Which SQL statement is used to start reading rows from a cursor?

easy📝 Conceptual Q2 of 15
SQL - Stored Procedures and Functions
Which SQL statement is used to start reading rows from a cursor?
AOPEN cursor_name
BFETCH cursor_name
CDECLARE cursor_name
DCLOSE cursor_name
Step-by-Step Solution
Solution:
  1. Step 1: Identify cursor lifecycle commands

    DECLARE defines the cursor, OPEN prepares it for use, FETCH reads rows, CLOSE ends it.
  2. Step 2: Determine which starts reading rows

    OPEN is needed before fetching rows; it starts the cursor operation.
  3. Final Answer:

    OPEN cursor_name -> Option A
  4. Quick Check:

    Start reading rows = OPEN [OK]
Quick Trick: OPEN prepares cursor to read rows; FETCH gets rows [OK]
Common Mistakes:
  • Using FETCH before OPEN
  • Confusing DECLARE with starting cursor
  • Closing cursor before reading

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes