17,377
社区成员
发帖
与我相关
我的任务
分享
create proc sp_test1
as
begin
select *
from test1
end
create or replace procedure sp_test1 is
begin
select *
from test1
end
create or replace procedure sp_test1 is
type t is table of sys.users%rowtype index by binary_integer;
test t;
begin
select * bulk collect into test from sys.users;
end;
--PROCEDURE SYS.SP_TEST1
--PLS-00597: INTO列表中的表达式'TEST' 无效
--select * bulk collect into test from sys.users;
--ORA-00904: 无效列名
--select * bulk collect into test from sys.users;
--SQL Statement ignored
--select * bulk collect into test from sys.users;
下面是返回表users的结果集,以游标返回
create or replace procedure sp_test1
(o_table out sys_refcursor) as
begin
open o_table for select * from sys.users;
end;
create proc sp_test1
as
begin
select * from sys.users
end
create or replace procedure sp_test1 is
type t is table of sys.users%rowtype index by binary_integer;
test t;
begin
select * bulk collect into test from sys.users;
end;
create or replace procedure sp_test1 is
type t is table of test1%rowtype index by binary_integer;
test t;
begin
select * bulk collect into test from test1;
end;
create or replace procedure sp_test1 is
type t is table of test1%rowtype;
begin
select * into t
from test1;
end;