Click here to Skip to main content
15,885,956 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am executing below stored procedure on pl/sql developer


SQL
create or replace procedure Demo
(
        Id IN INTEGER
)
IS

begin
    select * from METRICTYPE where ID=ID;
end Demo3;



Below is the error
PLS-00428:an INTO clause is expected in this select statement



Please Advise
Posted

1 solution

PL/SQL syntax is different fro many other SQL...
Any SELECT query (except sub-queries) must put it's values in variables...
Like:
SQL
DECLARE
M_TYPE VARCHAR2(50);

SELECT TYPE
INTO M_TYPE
FROM METRICTYPE WHERE ID = ID;

This of course have the problem not to return the values you want...for that you may use REFCURSOR[^] of PL/SQL...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900