create table importer_report_bkp_20250527 as (
select * from importer_report where  IMPORT_DATE <'15-MAY-25'
);

------------------------------------------------------------------------------------------------------------------

create table import_error_bkp_20250527 as (
select * from import_error where AUTOIMPORTERREPORTID in (select ID from importer_report where  IMPORT_DATE <'15-MAY-25')
);

-------------------------------------------------------------------------------------------------------------------------

delete from import_error where AUTOIMPORTERREPORTID not in (select ID from importer_report);

-------------------------------------------------------------------------------------------------------------------------

delete from import_error where AUTOIMPORTERREPORTID in (select ID from importer_report where  IMPORT_DATE <'15-MAY-25');

-------------------------------------------------------------------------------------------------------------------------
delete from importer_report where  IMPORT_DATE <'15-MAY-25';