Saturday, May 17, 2014

Examples of XMLCONCAT in PLSQL

SET serveroutput ON size 300000;
DECLARE
  LV_PAYMENT_TYPE_XML XMLTYPE;
  l_string VARCHAR2(1000);
BEGIN
  SELECT XMLCONCAT(xmlelement("C_EXCHANGE_RATE",'1.2'), xmlelement("C_EXCHANGE_RATE_TYPE",'user'))
  INTO LV_PAYMENT_TYPE_XML
  FROM DUAL;
  l_string:= LV_PAYMENT_TYPE_XML.getStringVal();
  DBMS_OUTPUT.PUT_LINE(l_string) ;
  SELECT XMLCONCAT(LV_PAYMENT_TYPE_XML,xmlelement("C_EXCHANGE",'1.2'))
  INTO LV_PAYMENT_TYPE_XML
  FROM DUAL;
  l_string:= LV_PAYMENT_TYPE_XML.getStringVal();
  DBMS_OUTPUT.PUT_LINE(l_string) ;
END;
    
Reactions:

0 comments:

Post a Comment