手记

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;

0人推荐
随时随地看视频
慕课网APP