09 October 2014

How to delete XML Templete in oracle R12

Use the following code to delete a Template Code

declare
l_templateCode varchar2 (100) := ; -- Template Code
begin
for r in (select t1.application_short_name template_app_name,
t1.data_source_code,
t1.application_short_name def_app_name
from xdo_templates_b t1
where t1.template_code = l_templateCode)
loop

xdo_templates_pkg.delete_row (r.template_app_name, l_templateCode);

delete from xdo_lobs
where lob_code = l_templateCode
and application_short_name = r.template_app_name
and lob_type in ('TEMPLATE_SOURCE', 'TEMPLATE');

delete from xdo_config_values
where application_short_name = r.template_app_name
and template_code = l_templateCode
and data_source_code = r.data_source_code
and config_level = 50;

end loop;
end;