创建存储过程时出错,大家帮我看看错在哪里?
语句
create or replace procedure a1 as
begin
select * from aladdinagent_dicinfo;
end;
错误提示
pls:在此Select语句中缺少INTO子句
PL/SQL:Statement ignore
------解决方案--------------------select * from aladdinagent_dicinfo;必須要into..
不能像sql server那樣返回數據
------解决方案--------------------create or replace procedure a1(aaa out varchar2)
as
begin
select a into aaa from aladdinagent_dicinfo;
end;
------解决方案--------------------按照你的想法你的存储过程应该这样写
create or replace package aaa
is
type cur is ref cursor;//定义游标
procedure a1(Rst out cur);
end aaa;
/
create or replace package body aaa
is
procedure a1(Rst out cur)
is
begin
open a1 for select * from aladdinagent_dicinfo; //这样才可以返回一个结果集
end;
end aaa;