Tuesday, 15 October 2013

Deleting a template from back end

declare   
   l_templateCode    varchar2 (100) := 'XX_AR_XXXREPORT'; -- 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;


--
Best Regards,
Boge Prasanth kumar Reddy.

No comments: