Home » SQL & PL/SQL » SQL & PL/SQL » INTO clause error
INTO clause error [message #187485] Mon, 14 August 2006 03:48 Go to next message
monasingh
Messages: 229
Registered: May 2006
Location: Mumbai
Senior Member

Hi,
I have created a cursor usinf FOR LOOP. Inside that I am using some select statements like the one below.

142 IF TRIM(v_dc_loc) IS NOT NULL THEN
143       SELECT 1 FROM stsc.sku
144        WHERE item = c_purch_ei_intran.item
145          AND loc = v_dc_loc
146          AND scen = 0;
147      IF SQL%ROWCOUNT < 1 THEN
148         v_dc_loc := NULL;
149      END IF;
150    END IF;

But I am getting the below error :

ERROR at line 143:
ORA-06550: line 143, column 11:
PLS-00428: an INTO clause is expected in this SELECT statement
ORA-06550: line 143, column 11:
PL/SQL: SQL Statement ignored


What is that asking for INTO clause. Please advice.
Re: INTO clause error [message #187486 is a reply to message #187485] Mon, 14 August 2006 03:50 Go to previous messageGo to next message
Littlefoot
Messages: 20895
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You have to select "1" into a variable:

DECLARE dummy NUMBER(1);
...
SELECT 1
INTO dummy
FROM stsc.sku
WHERE item = c_purch_ei_intran.item
...
Re: INTO clause error [message #187487 is a reply to message #187485] Mon, 14 August 2006 03:51 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
Recode line 143 to something like SELECT 1 INTO v_dummy FROM stsc.sku

PS: Remember to declare variable v_dummy.
Re: INTO clause error [message #187493 is a reply to message #187487] Mon, 14 August 2006 04:18 Go to previous message
monasingh
Messages: 229
Registered: May 2006
Location: Mumbai
Senior Member

Thanks you so much. This worked.
Previous Topic: On External Table
Next Topic: error ORA-00604
Goto Forum:
  


Current Time: Mon Dec 05 15:03:33 CST 2016

Total time taken to generate the page: 0.30216 seconds