Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
And I need use this table list, in other sentence:
a_5min_001 a_5min_002 a_5min_003
output, for tablename=a_5min_001
select distinct pointnumber from <hisrfrequency.tablename>;
Then for each pointnumbers, execute a delete, for example
10001 10002 10003 ...
They could send me some example to follow?
DECLARE cursor c1 is select * from hisrfrequency; r1 c1%ROWTYPE; cursor c2 (r1 c1%ROWTYPE) is select distinct pointnumber from r1.tablename; r2 c2%ROWTYPE; str_del VARCHAR2(300); begin open open c1; loop fetch c1 into r1; exit when c1%notfound; dbms_output.put_line(chr(10)||r1.tablename); begin open c2(r1.tablename); loop fetch c2 into r2; exit when c2%notfound; dbms_output.put_line(chr(10)||r2.pointnumber); str_del := 'delete <r1.tablename> where pointnumber = <r2.pointnumber>'; execute immediate str_del; end loop; close c2; end; end loop; close c1; end; /