I am creating a simple procedure, in SQL, simply its operation is based on returning the data of those incidents that are in situation = 2 and have not reached the situation = 3, together with the name of the reporting user and the type of user.
The problem is that when compiling I miss this warning: Error (4,3): PLS-00428: an INTO clause is expected in this SELECT statement How can I change my code to be correct?
create or replace
PROCEDURE incidenciasDatos2 IS
BEGIN
SELECT i.id_reportador, i.id_tipo, s.* FROM incidencia i, situacion s
WHERE i.id_incidencia = s.id_incidencia AND s.id_estado = 2 AND s.id_estado <> 3;
END;