Wednesday, April 2, 2014

Deleting a XML Template from backend

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;

------------------------------------------------------------------------------------------------
How to delete XML Data Definition and Data Template from Backend:
------------------------------------------------------------------------------------------------


select * from XDO_TEMPLATES_B   where template_code    = :p_template_code;

select * from XDO_TEMPLATES_TL  where template_name ='XX_A+_INVOICES_TT'--code    = :p_template_code

select * from XDO_LOBS  where lob_code = :p_template_code

select * from XDO_DS_DEFINITIONS_TL where DATA_SOURCE_CODE='XX_A+_INVOICES'

select * from XDO_DS_DEFINITIONS_B where DATA_SOURCE_CODE='XX_A+_INVOICES'

select * from XDO_DS_DEFINITIONS_B where DATA_SOURCE_CODE='XX_A+_INVOICES'


delete from XDO_DS_DEFINITIONS_TL -- where data_source_code = :p_template_code
where  DATA_SOURCE_CODE='XX_A+_INVOICES';

delete from XDO_DS_DEFINITIONS_B --  where data_source_code = :p_template_code
where DATA_SOURCE_CODE='XX_A+_INVOICES'


delete from XDO_TEMPLATES_B  --      where template_code    = :p_template_code
where template_code = 'XX_A+_INVOICES'

delete from XDO_TEMPLATES_TL   
where template_code = 'XX_A+_INVOICES' 

select * from XDO_DS_DEFINITIONS_VL
where DATA_SOURCE_CODE='XX_A+_INVOICES'

DELETE
--select *
FROM XDO_LOBS
WHERE LOB_CODE='XX_A+_INVOICES'

select * from XDO_LOBS WHERE LOB_CODE='XX_A+_INVOICES';

No comments:

Post a Comment