你用system去建 关sfc权限什么关系这个是因为你语句的问题??? 在pl/sql中是不能够直接使用select test from table_name;
那查詢該怎楊寫呢?sqlplus我已經找到,命令窗口。
存储过程中不能使用select test from table_name;只可以 declare temp integer:=0; begin select test into temp from table_name; if temp>5 then end if;end;如果要返回记录集合使用cursorcreate or replace package MyPackage type my_cursor is ref cursor; procedure GetAllRecord(p_cursor out my_cursor) is begin open p_cursor for select * from table_name; end GetAllRecord;end MyPackage;
在oracle存储过程中,如果提取某一条记录的某些字段值,则可以用select...into.... 如果是一些结果集,则必须使用cursor 绝对不能在存储过程中仅使用select...from..... 你的例子应该改为: create or replace procedure sp_test_1118 is temp integer; begin select test into temp from sfc.test_x where id=1 end sp_test_1118;
老兄让大家猜闷呢!你想问大家什么啊!是这个存储过程不能执行吗? 这样做看看: create or replace procedure sft.sp_test_1118 is begin select test from sfc.test_x where id=1 end sp_test_1118;
在pl/sql中是不能够直接使用select test from table_name;
declare temp integer:=0;
begin
select test into temp from table_name;
if temp>5 then
end if;end;如果要返回记录集合使用cursorcreate or replace package MyPackage
type my_cursor is ref cursor;
procedure GetAllRecord(p_cursor out my_cursor)
is
begin
open p_cursor for select * from table_name;
end GetAllRecord;end MyPackage;
如果是一些结果集,则必须使用cursor
绝对不能在存储过程中仅使用select...from.....
你的例子应该改为:
create or replace procedure sp_test_1118 is
temp integer;
begin
select test into temp from sfc.test_x where id=1
end sp_test_1118;
这样做看看:
create or replace procedure sft.sp_test_1118 is
begin
select test from sfc.test_x where id=1
end sp_test_1118;