Oracle PL/SQL Error PLS-00428: 'INTO' Clause Missing in SELECT Statement
This error occurs when you use a SELECT statement within a PL/SQL stored procedure without an INTO clause. In PL/SQL, SELECT statements must include an INTO clause to store the result into a variable.
For example, here's a simple PL/SQL stored procedure that selects a number and stores it in a variable:
CREATE OR REPLACE PROCEDURE get_number
IS
my_number NUMBER;
BEGIN
SELECT 42 INTO my_number FROM dual;
DBMS_OUTPUT.PUT_LINE('The number is: ' || my_number);
END;
/
In this example, the INTO clause stores the result of the SELECT statement in the my_number variable. Omitting the INTO clause will result in the 'PLS-00428: an INTO clause is expected in this SELECT statement' error.
原文地址: https://www.cveoy.top/t/topic/qAlG 著作权归作者所有。请勿转载和采集!