declare
cursor csr_dept
is
select company_name,BUSINESS_REG_NUM,ORG_CODE,CORE_ID
from t_core_company where core_id is null for update of CORE_ID;
row_dept csr_dept%rowtype;
t varchar2(35);
begin
--for循环
for row_dept in csr_dept loop
--取同义词
select QUERY_GET_COMPANY_UUID(row_dept.company_name,row_dept.business_reg_num,row_dept.org_code) into t from dual;
update t_core_company set CORE_ID=t where current of csr_dept;
end loop;
commit;
end;