All,
I solved this in the brutal way. This is data that is in the database only and there is no applications (to perform CRUD options) available for the end customer, so this is a solution that works for this customer. Remember I do violate the waranty with IFS for this, but once again the customer doesn’t have the intention to use IFS Application and only has access to the database.
My solution is to remove the data from the tables:
declare
company_ site.company%type := 'TST';
site_ site.contract%type;
rem_start_ date;
rem_end_ date;
/**
Use the following select to prepare the list of tables that contain a certain column. Paste result in the loop.
select
'delete from ' || table_name || ' where ' || column_name || ' = ' || 'site_;' Statement
from
(select DISTINCT C.TABLE_NAME, C.COLUMN_NAME
from User_Tab_Columns C, USER_TABLES T, USER_TAB_COMMENTS TC
WHERE C.TABLE_NAME = T.TABLE_NAME
AND TC.TABLE_NAME = T.TABLE_NAME
AND C.column_name in ('CONTRACT', 'SITE')
AND T.TABLESPACE_NAME = 'IFSAPP_DATA'
AND TC.TABLE_TYPE = 'TABLE');
**/
cursor get_sit is
select contract from site
where company = company_;
begin
for rec in get_sit
loop
site_ := rec.contract;
delete from MAINT_TEAM_TAB where CONTRACT = site_;
-- All other deletes based upon site
delete from FAMILY_SET_DATA_TAB where CONTRACT = site_;
commit;
end loop;
--delete from SITE_TAB where CONTRACT = site_;
-- Now that the sites are gone, remove the company
delete from BUDGET_TEMPLATE_ARCH_FILE_TAB where COMPANY = company_;
-- All other deletes based upon company
delete from COMPANY_SITE_TAB where COMPANY = company_;
commit;
end;
-----
I did have a performance problem as it proofed that some tables had been triggered to log deletions to history_log_tab. I have not taken the time to find out how to turn of the triggers to the history log (when only having the database with its api’s in place).
If you use the above, be aware, you are on your own and IFS nor Eqeep nor I, will not support you.
Regards,
Steve