--创建临时表
create table test_table_tmp(test_id varchar2(50),test_name varchar2(50),modify_date date);
insert into test_table_tmp values('3','c',sysdate);
create table test_table as select * from test_table_tmp where 1 = 2
--创建存储过程 传入参数 test_num 传出参数 out_num
create or replace procedure My_test_proce(test_num in varchar,out_num out varchar)
as
cursor test_cur is select * from test_table_tmp;
begin
dbms_output.put_line(test_num);
for test_table in test_cur loop
out_num := test_table.test_name;
dbms_output.put_line(test_table.test_id||test_table.test_name||test_table.modify_date);
insert into test_table values(test_table.test_id,test_table.test_name,test_table.modify_date);
commit;
end loop;
end;
--调用存储过程
declare
test_num varchar(50);
begin
My_test_proce('2',test_num);
dbms_output.put_line(test_num);
end;
本文链接:https://my.lmcjl.com/post/12527.html
4 评论