PLSQL error

Running the  code below in a TOAD editor window,  I receive the following error:
v_ORG VARCHAR2(40) := '';
v_TMF VARCHAR2(40) := '';
BEGIN
SELECT v_ORG/*,
        (CASE
           when US_USERNAME in ('SAJEB') then v_ORG := 'SUPERVISOR'
           else v_ORG := 'NOT SUPERVISOR'
         END
         ) */
      FROM imaging_history.ir_base_mv irb
      ;
END;
Error at line 1
ORA-06550: line 5, column 1:
PLS-00428: an INTO clause is expected in this SELECT statement

Script Terminated on line 1.
This does not make sense to me. I would appreciate your help.
Sincerely,
Christine
DECLARE 
v_ORG VARCHAR2(40) := '';
v_TMF VARCHAR2(40) := '';
BEGIN
SELECT v_ORG/*,
        (CASE 
           when US_USERNAME in ('SAJEB') then v_ORG := 'SUPERVISOR'
           else v_ORG := 'NOT SUPERVISOR'
         END 
         ) */
      FROM imaging_history.ir_base_mv irb
      ;
END;

Open in new window

cringlebAsked:
Who is Participating?
 
sonicefuCommented:
into v_ORG is required
DECLARE 
v_ORG VARCHAR2(40) := '';
v_TMF VARCHAR2(40) := '';
BEGIN
SELECT v_ORG into v_ORG/*,
        (CASE 
           when US_USERNAME in ('SAJEB') then v_ORG := 'SUPERVISOR'
           else v_ORG := 'NOT SUPERVISOR'
         END 
         ) */
      FROM imaging_history.ir_base_mv irb
      ;
END;

Open in new window

0
 
sonicefuCommented:
what is the column name of the table/view imaging_history.ir_base_mv which you want to retrieve/fetch  ?

SELECT v_ORG  <---- here should be the column name which you want to retrieve, v_ORG is a variable name.
      FROM imaging_history.ir_base_mv irb
      ;


you statement should be

SELECT tableColumnName INTO variableName
FROM tableName;


in your statement you mentioned the variable name but not the table column name.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.