Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle Procedure error (PLS-00428)

This is the error message: PLS-00428: an INTO clause is expected in this SELECT statement. Meanwhile, this is the procedure for testing displaying the system date:

CREATE OR REPLACE 
PROCEDURE "TEST_PROCEDURE"
AS
BEGIN
    SELECT SYSDATE FROM DUAL;
END;

In the first place I don't need to use that INTO Oracle is insisting for me to do. Is there other way around beside using a cursor (I've seen it here https://stackoverflow.com/a/6029963/1983024)? I think it should not be like that, this does run normally just like in MS SQL without using INTO or cursor.

like image 299
Jon P Avatar asked Jan 24 '13 06:01

Jon P


People also ask

How do I fix Ora 01403 No data found?

If you attempt to access the updated files at a later date, the ORA-01403 error will occur. To fix this, re-create tables from the initial controlling database.

What is procedure and function in Oracle?

A procedure is a subprogram that performs a specific action. You specify the name of the procedure, its parameters, its local variables, and the BEGIN-END block that contains its code and handles any exceptions. A function is a subprogram that computes and returns a value.


1 Answers

In the first place I don't need to use that INTO Oracle is insisting for me to do.

The fact is, Oracle is correct: you do need to use an INTO to take the return value.

After all, if you want to display the result of the query you're going to need a variable to put it in first.

like image 179
Jeffrey Kemp Avatar answered Sep 26 '22 01:09

Jeffrey Kemp