可以不需要建包 下本PL/SQL程序设计看看吧 我们大部分程序是都不需要建包的 都用基本的PL/SQLcreate or replace procedure p_test(i_1 varchar2,....参数列表) as
v_name varchar2(10);
v_id number(2);
begin
insert into test values(i_1,......);
end;
v_name varchar2(10);
v_id number(2);
begin
insert into test values(i_1,......);
end;
l_col1 varchar2(10);
l_col2 number(2);
begin
select col1, col2 into l_col1, l_col2 from table_name where col3 = i_1 and ...;
end;
type mycursor is ref cursor; -- 定义游标变量
procedure p_test(i_1 varchar2,..., l_cursor out mycursor); -- 定义过程,用游标变量作为返回参数
end TestPackage;create or replace procedure p_test(i_1 varchar2,..., l_cursor out mycursor) as
begin
open l_cursor for select * from table_name where col3 = i_1 and ...;
end;大概的写法就是这样,但是现在我没有环境,没有办法测试是否正确