Forum Stats

  • 3,759,437 Users
  • 2,251,543 Discussions


XMLoutput in Apex 5.1

Jadey_apex Member Posts: 8 Red Ribbon
edited Jul 8, 2021 12:07PM in Java Technology & XML

Dear All,

I have a xml query like this:

SELECT XMLELEMENT("SetField",'<SetFieldname="acct_nr">'||''||'rekeningnummer_rec.rekeningnummer'||''||'</SetField>')      

,XMLELEMENT("SetField",'<SetField name="agent_nr">'||''||wa_rec.agent_nummer||''||'</SetField>')  

 ,XMLELEMENT("SetField",'<SetField name="cost_code">'||''||'wa_rec.agent_nummer'||''||'</SetField>')

 ,XMLELEMENT("SetField",'<SetField name="cur_code">'||''||'CASE 

                                when rekeningnummer_rec.tgl_systeem_naam = pva_const_pkg.g_tgl_waprovisiejaar

                                THEN lc_srd

                                when rekeningnummer_rec.tgl_systeem_naam = pva_const_pkg.g_tgl_waprovisiejaaragent

                                then lc_srd

                                else lc_pseudo_empty_str

                                end '||''||'</SetField>')

INTO l_wa_xml_data_clob

from dual;

My output in Apex 5.1 is like this:

<SetField name="acct_nr">rekeningnummer_rec.rekeningnummer</SetField><SetField name="agent_nr"></SetField><SetField name="cost_code">wa_rec.agent_nummer</SetField><SetField name="cur_code">CASE when rekeningnummer_rec.tgl_systeem_naam = pva_const_pkg.g_tgl_waprovisiejaar THEN lc_srd when rekeningnummer_rec.tgl_systeem_naam = pva_const_pkg.g_tgl_waprovisiejaaragent then lc_srd else lc_pseudo_empty_str end </SetField>

My problem is that the variables given in bold should be replaced by values which are from cursors.

But instead of that I get no value between the tags.

Can someone help me out with this?

I will be very grateful if someone could help me out with this.

Thanx in advance.