0

In writing a Conditional Control Case Statement in PL/SQL, I got this error. My code is below. Is there a particular way I need to do the > and < signs or did I overlook something. Any help would be great.

ORA-06550: line 11, column 6:
PLS-00103: Encountered the symbol ">" when expecting one of the following:

( - + case mod new not null <an identifier>
<a double-quoted delimited-identifier> <a bind variable>
continue avg count current exists max min prior sql stddev
sum variance execute forall merge time timestamp interval
date <a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specif

  1. DECLARE
  2. v_country_name wf_countires.country_name%TYPE := 'United States';
  3. v_airports wf_countries.airports%TYPE;
    `

    DECLARE
    v_country_name wf_countires.country_name%TYPE := 'United States';
    v_airports wf_countries.airports%TYPE;
    BEGIN
    SELECT airports INTO v_airports
    FROM wf_countries
    WHERE country_name = v_country_name;
    v_country_name :=
    CASE v_airports
    When > 10000 THEN 'There are greater more than 10000 airports'
    When < 10000 THEN 'There are between 1001 and 10000 airports'
    When < 1000 THEN 'There are between 101 and 1000 airports'
    When < 100 THEN 'There are 100 or fewer airports'
    ELSE 'The number of airports is not available for this country'
    END CASE;
    END;

2
Contributors
1
Reply
12
Views
2 Years
Discussion Span
Last Post by pritaeas
0

I think the problem is your SELECT INTO could return more than one record, so v_airports might be considered an array.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.