Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> ERROR:an INTO clause is expected in this SELECT statement

ERROR:an INTO clause is expected in this SELECT statement

From: wilhelm <wakeschNOwaSPAM_at_gmx.de.invalid>
Date: 2000/06/28
Message-ID: <28670e88.98b4fdb0@usw-ex0102-084.remarq.com>#1/1

Hallo my all friends

This is a PL/SQL-Script for Oracle which write dependet from the minutes a column name in a varible for the select-statment

If i start the PL/SQL-Script only with the if-statment It works correct.

If i start the PL/SQL-Script only with the select-statment It works correct.

If i start the PL/script with both (if- and select-statement Then the system write the follow error:
What is wrong ?

select datum, wert_8
*
Error in line 22:

ORA-06550: line 22, column 1:
PLS-00428: an INTO clause is expected in this SELECT statement
ORA-06550: line 22, column 1:

PL/SQL: SQL Statement ignored

-
BEGIN
DECLARE
now_time varchar2(2);
colname varchar2(7);

BEGIN
now_time:=to_char(sysdate,'mi');

IF now_time='01' THEN
Colname:='wert_20';
ELSIF now_time='02' THEN
Colname:='wert_20';
ELSIF now_time='03' THEN
Colname:='wert_20';
ELSIF now_time='04' THEN
Colname:='wert_1';
ELSIF now_time='04' THEN
Colname:='wert_1';
ELSIF now_time='04' THEN
Colname:='wert_1';
...........
............
ELSE
Colname:='wert_19';
END IF; select datum, wert_8 from tabelle1
where datum = (select max(datum) from tabelle1) END;
END;
/


I now the column wert_8 is not necessary. That’s only a test. In the next step I want to write instead of wert_8 the Variable Colname.
How functioning it ?

Got questions? Get answers over the phone at Keen.com. Up to 100 minutes free!
http://www.keen.com Received on Wed Jun 28 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US