trigger

trigger
create or replace trigger pm4h_hw_db.t_get_sys_bhstore
  after insert on pm4h_ad.sys_bhstore
declare
  pragma autonomous_transaction;
  tablename varchar2(64);
  cursor cr is
    select bhtable from pm4h_ad.sys_bhstore where bhmodelid = 'TODBH';
begin
  open cr;
  fetch cr
    into tablename;
  while cr%found loop
    if fun_is_exists_table(tablename) = 0 then
      pm4h_hw_db.create_bh_table(tablename);
    end if;
    fetch cr
      into tablename;
  end loop;
  close cr;
end pm4h_hw_db.t_get_sys_bhstore;

你可能感兴趣的:(trigger)