Multiple choice technology

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';

  6. There are no errors in these statements

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

The INTO clause must appear AFTER the SELECT clause in PL/SQL cursor declarations. The correct order is: CURSOR name IS SELECT columns INTO variables FROM table WHERE condition. Here 'into my_city, my_state' appears before 'from CITIES', which is a syntax error.