procedure
1 2 3 4 5 6 7 8 9 10 11 | create or replace procedure delete_from_starts_with(p_schema varchar2, p_prefix varchar2) as begin for record in ( select x.table_name origin_name from dba_tables x where x.owner = p_schema and x.table_name like (p_prefix || '_%' ) ) loop execute immediate ( 'delete from ' || record.origin_name); end loop; end ; |
1 2 3 | begin delete_from_starts_with( 'MY_SCHEMA' , 'MY_TABLE_NAME_PREFIX' ); end ; |
ไม่มีความคิดเห็น:
แสดงความคิดเห็น