我有一个这样的 PL/SQL 语句(它不是存储过程或函数):
DECLARE
curstatus VARCHAR(2);
person_id varchar(6) := 100;
BEGIN
SELECT cur_status INTO curstatus FROM Persons WHERE PID=cast(person_id as number(6));
IF curstatus='F' THEN
SELECT PID FROM Reports WHERE Report_Type='F' AND PID = person_id;
END IF;
END;
我想从报告中返回所有 PID(将它们显示到屏幕上),但是我收到一个错误:an INTO clause is expected
.
请注意,这不是存储过程或函数。我怎样才能退回桌子?