Database Reference
In-Depth Information
and recreating the same using XDB would be really a big waste of time and effort. Thus,
we have to find the ways to reuse existing cursors in XML construction procedures. Obvi-
ously, we will again use the custom approach and we are about to present it to you in a
very concise way. Teaching you PL/SQL is not the purpose of this topic, so we believe
that you can figure out the simple commands behind the XXCU_COMMON_UTIL_* pack-
ages we employ in our examples.
The custom message constructor can be implemented by performing the following simple
steps:
1. Make sure that all necessary cursors are public and valid.
2. Create temporary CLOB for further EBO construction and open it using the fol-
lowing line of code:
v_olob :=
XXCU.XXCU_COMMON_UTIL.createtmpclob;DBMS_LOB.OPEN
(v_olob, 1);
3. Open initial tags according to your XSD and open cursor using the following
code:
XXCU.XXCU_COMMON_UTIL_XML.open_xml_tag (v_olob,
'CreditMonitoring');XXCU.XXCU_COMMON_UTIL_XML.print_xml_tag
(v_olob,'CountryCode', ip_countrycode);OPEN
creditmonitoring_cur(ip_countrycode); LOOP FETCH
creditmonitoring_cur INTOcreditmonitoring_rec; EXIT
WHENcreditmonitoring_cur%NOTFOUND;
Construct the Business Object XML. If you have nested nodelists—call procedures for
their construction. To do so, just pass your temporary CLOB to a subprocedure and use
the same construction steps. Do it in a loop if you have recordsets with many rows, shown
as follows:
XXCU.XXCU_COMMON_UTIL_XML.open_xml_tag (v_olob, 'Company');
v_country_id_attr :=
XXCU.XXCU_COMMON_UTIL_XML.get_attribute ('CountryCode',
creditmonitoring_rec.country_code);XXCU.XXCU_COMMON_UTIL_XML.print_xml_tag
(v_olob, 'Country', creditmonitoring_rec.country );
XXCU.XXCU_COMMON_UTIL_XML.print_xml_tag (v_olob,
Search WWH ::




Custom Search