Bird
0
0

Which of the following is the correct syntax to fetch the next row from a cursor named cur1?

easy📝 Syntax Q3 of 15
PostgreSQL - Advanced PL/pgSQL
Which of the following is the correct syntax to fetch the next row from a cursor named cur1?
AFETCH NEXT FROM cur1;
BFETCH cur1 NEXT;
CFETCH FROM cur1 NEXT;
DFETCH NEXT cur1;
Step-by-Step Solution
Solution:
  1. Step 1: Recall FETCH syntax

    The standard syntax to fetch the next row is FETCH NEXT FROM cursor_name;
  2. Step 2: Match options

    Only FETCH NEXT FROM cur1; matches the correct syntax exactly.
  3. Final Answer:

    FETCH NEXT FROM cur1; -> Option A
  4. Quick Check:

    Fetch next row syntax = FETCH NEXT FROM cursor [OK]
Quick Trick: FETCH NEXT FROM cursor_name fetches one row [OK]
Common Mistakes:
  • Misplacing NEXT keyword
  • Omitting FROM keyword
  • Incorrect order of cursor name and NEXT

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes