继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Oracle海量数据快速处理bulk

慕尼黑5497867
关注TA
已关注
手记 378
粉丝 23
获赞 80

Oracle海量数据快速处理bulk

Procedure P_EmployeeAccount( Ri_Ret Out Int,

Rv_Msg Out Varchar2) Is

Rec_Test_2021 Test_2021%Rowtype;

type type_tmp is record(

A Test_2021.A%type,

B Test_2021.B%type,

C Test_2021.C%type);

type type_record is table of type_tmp index by binary_integer;

tab_type_record type_record;

ii integer :=0;

Begin

Ri_Ret :=Null;

Rv_Msg :=‘执行成功!’;

tab_type_record.delete;

ii :=0;

Select A,B,C bulk collect

into tab_type_record From Test_2021 a Where 1=1;

if tab_type_record.count <=0 then

return;

end if;

for ii in tab_type_record.first … tab_type_record.last loop

Insert Into TEST_2021(A,B,C)

Select

tab_type_record(ii).A,

tab_type_record(ii).B,

tab_type_record(ii).C

From Test_2021 t Where 1=1;

End Loop;

End P_EmployeeAccount;

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP