PLS-00428: an INTO clause is expected in this SELECT statement
這意味着你需要一個INTO
接近,當你從PL/SQL發佈裸SELECT
。
:d
更有建設性:您認爲在您選擇的結果會去在該代碼片段?
create or replace procedure login_info
(username IN varchar2, password IN varchar2, result OUT number)
as
begin
select * from login;
end;
您必須以某種方式檢索它以便通過PL/SQL代碼進行處理。假設你有幾行收集,你應該使用BULK COLLECT INTO
:
create or replace procedure login_info
(username IN varchar2, password IN varchar2, result OUT number)
as
type my_tbl_type IS TABLE OF login%ROWTYPE;
my_tbl my_tbl_type;
begin
select * BULK COLLECT INTO my_tbl from login;
-- do whatever you
-- need here
-- on `my_tbl`.
end;
最後一點,也許你在找一個明確的CURSOR
呢?你應該明確地看看PL/SQL 101: Working with Cursors。這是一個關於SELECT ... INTO ...
和CURSOR
操作的有趣討論。