Multiple choice

In this PL/SQL statement, which of the following lines will produce an error?

  1. cursor CAPITALS is

  2. select CITY, STATE

  3. into my_city, my_state

  4. from CITIES

  5. where CAPITAL = 'Y';

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The INTO clause must come after the SELECT statement's column list but before the FROM clause. The correct order in a cursor declaration is: CURSOR name IS SELECT column_list INTO variable_list FROM table WHERE condition. The 'into my_city, my_state' line is misplaced in the structure.