XMLELEMENT

I have the following:
DECLARE
   CURSOR c_xml
   IS
      SELECT XMLELEMENT ("CHECKINOUT"
                        ,xmlattributes (property_id AS "PROPERTY"
                                       ,msgid AS "ID"
                                       ,status AS "STATUS"
                                       ,lead_name AS "OCCUPANT"
                                       ,email AS "email"
                                       ,unit_ext AS "EXTENSION"
                                       ,folio_id AS "FOLIO")) AS tosend
      FROM   TABLE (pm_pbx_systems.checkinout ('PHR'));
  TYPE records IS TABLE OF c_xml%rowtype;
  charges        records;
  v_content     varchar2(32000);
BEGIN
open c_xml;
fetch c_xml bulk collect into charges;
close c_xml;
dbms_output.put_line(charges(1).tosend);
for i in charges.first .. charges.last loop
v_content := v_content||charges(i).tosend;
end loop;
end;
When I try to access charges(1).tosend I get
[Error] Execution (25: 1): ORA-06550: line 24, column 1:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 24, column 1:
PL/SQL: Statement ignored
ORA-06550: line 25, column 14:
PLS-00306: wrong number or types of arguments in call to '||'
ORA-06550: line 25, column 1:
PL/SQL: Statement ignored
How do I access this information? I want to create an object that can be used to send via UTL_HTTP.write_text ( r         => v_req, DATA => v_content );
Any help would be appreciated.
Thank you

XMLElement returns an XMLType data type.  DBMS_OUTPUT has no clue how to handle that data type.  In order for DBMS_OUTPUT to be able to do what you want, you would need something like
DECLARE
   CURSOR c_xml
   IS
      SELECT XMLELEMENT ("CHECKINOUT"
                        ,xmlattributes ('1' AS "PROPERTY"
                                       ,'2' AS "ID"
                                       ,'3' AS "STATUS"
                                       ,'4' AS "OCCUPANT"
                                       ,'5' AS "email"
                                       ,'6' AS "EXTENSION"
                                       ,'7' AS "FOLIO")) AS tosend
      FROM   dual;
  TYPE records IS TABLE OF c_xml%rowtype;
  charges        records;
  v_content     varchar2(32000);
BEGIN
   open c_xml;
   fetch c_xml bulk collect into charges;
   close c_xml;
   dbms_output.put_line(charges(1).tosend.getStringVal());
   for i in charges.first .. charges.last loop
      v_content := v_content||charges(i).tosend.getStringVal();
   end loop;
end;
I used .getStringVal() to convert the XMLType into a VARCHAR2 value.  That works for up to 4k worth of data.  There is also a .getClobVal().  Depending upon your version, you could wrap an XMLSerialize around the XMLElement and use XMLSerialize to convert the XMLType into VARCHAR2 instead of using .getStringVal().  That would be the preferred method.
Can you use XMLAgg in your query against the DB?  Not sure what your final v_content needs to look like so just throwing out options.

Similar Messages

  • How to Get a List of All XMLElements (Follow up to previous posting)

    (CS5, Win7, 64Bit)
    I need a collection (or array, etc.) of all the XMLElement objects in a given document in flat form (just like the "Structure Tree"'s hierarchichal view - only flatened).
    I could not find any "normal" way (i.e., built-in property or method) to get at the information. Instead, I found that I had to recurse through the entire XMLElement tree, starting with the Root Element. For a large document, this can take close to a ten minutes, and sometimes I have to do this for an InDesgin Book containing over ten enormous INDD files.
    After "கற்பனை Imagine" responded to my previous post about how to get all the XMLTags, I assumed that myDocument.xmlElements would return a collection of all the XMLElements in the Document. Unfortunately, it does not - it returns only the Root XMLElement. Thus, I have to recurse therough the hierarchy of XMLElements under the Root XMLElement - which takes a very long time.
    There HAS to be a better way, right?
    Would it be better were I to recurse through all PageItems in the document and then recurse through each PageItem's XMLElement tree? I assume that wouldn't make a big difference either way.
    I'm open to suggestions...
    TIA,
    mlavie

    mlavie:
    I could not find any "normal" way (i.e., built-in property or method) to get at the information. Instead, I found that I had to recurse through the entire XMLElement tree, starting with the Root Element. For a large document, this can take close to a ten minutes, and sometimes I have to do this for an InDesgin Book containing over ten enormous INDD files.
    What do you intend to do with this flat layout of XMLElements? That probably matters a great deal.
    If performance is really at play, you can try using XML Rules instead of interacting with the DOM from JavaScript. But they are complicated and confusing and more suited to declarative programming.
    Imagine suggests:
    var a = myroot.evaluateXPathExpression ("//*");
        xmlObjArray.push(a[b--]);
    Why not stop there? evaluateXPathExpression already returns an array, why iterate over it and push its elements into a new array? What's wrong with the return value?

  • XMLELEMENT/ XMLAGG functions - Fetching the result into a variable

    Hi, I have a query to generate an XML output. I have the following questions:
    1) I am typecasting the result from this query to a VARCHAR2 and I want to assign the output to a VARCHAR2 variable. Can you please help me with that. When I try to get this into a varchar variable, i get the following error:
    declare
    x varchar2(6000);
    begin
    SELECT CAST(xmlelement("itemMaster",
    xmlelement("itemNumber",lpad(d.dept_i,3,0)||lpad(d.class_i,2,0)||lpad(d.item_i,4,0)),
    xmlelement("itemDesc",NVL(d.ITEM_DESC_T,lpad(d.dept_i,3,0)||lpad(d.class_i,2,0)||lpad(d.item_i,4,0))),
    xmlelement("paltSize",p1_test),
    xmlelement("stdUOM",p1_test),
    xmlelement("sellByDayQty",d.sell_by_day_q),
    xmlelement("shflfUOM",p1_test),
    xmlelement("minShflfDayQty",d.min_shflf_day_q),
    xmlelement("itemCatgCode",NVL(d.dc_item_catg_c,'GM')),
    xmlelement("strgTempZoneCode",NVL(d.strg_tmpr_zone_c,'01')),
    xmlelement("retailAmt",retl_a),
    xmlelement("expireDateFlag",NVL(d.expire_date_f,'N')),
    xmlelement("randomWtFlag",NVL(d.rndm_wt_f,'N')),
    xmlelement("wetFlag",NVL(d.wet_f,'N')),
    xmlelement("areaCode",d.area_c),
    xmlelement("vcpQty",d.vcp_q),
    xmlelement("sspQty",d.ssp_q),
    xmlelement("hndlTypeCode",d.hndl_type_c),
    xmlelement("mstrPackTypeCode",d.mstr_pk_type_c),
    xmlelement("mstrItemTypeCode",NVL(d.mstr_item_type_c,'00')),
    xmlelement("sszCode",d.reg_ssz_excpt_c),
    xmlelement("agriFlag",NVL(d.agrl_f,'N')),
    xmlelement("itemRankCode",d.item_rank_c),
    xmlelement("hazardFlag",NVL(d.hazd_mtrl_f,'N')),
    xmlelement("createDate",to_char(d.create_d,'MM-DD-YYYY HH24:MI:SS')),
    xmlelement("updateDate",to_char(d.modf_ts,'MM-DD-YYYY HH24:MI:SS')),
    xmlelement("actvnDate",to_char(d.actvn_d,'MM-DD-YYYY HH24:MI:SS')),
    xmlelement("organicCode",d.ognc_c),
    xmlelement("lotCntlFlag",NVL(d.lot_cntl_f,'N')),
    xmlelement("flammableFlag",NVL(d.flam_c,'N')),
    xmlelement("recordMode",c.action_c),
    xmlelement("areaType",p1_test),
    xmlelement("uoms",
    xmlelement("uom",
    xmlelement("prodUOM",p1_test),
    xmlelement("ratioDen",p1_test),
    xmlelement("consldtRule",p1_test),
    xmlelement("unitWtQty",NVL(d.unit_wt_q,1)),
    xmlelement("vcpHeightQty",NVL(d.vcp_ht_q,1)),
    xmlelement("vcpWidthQty",NVL(d.vcp_wth_q,1)),
    xmlelement("vcpLengthQty",NVL(d.vcp_lgth_q,1)),
    xmlelement("layerQty",p1_test)
    (SELECT xmlelement("aliases",
    xmlagg(xmlelement("upcCode",trunc(b.bar_code_i))
    ORDER BY b.dept_i,b.class_i,b.item_i
    FROM dc_item_bar_code b,
    dc_item a
    WHERE a.dept_i = b.dept_i
    AND a.class_i = b.class_i
    AND a.item_i = b.item_i
    AND a.dept_i = c.dept_i
    AND a.class_i = c.class_i
    AND a.item_i = c.item_i
    AS VARCHAR2(4000)
    ) INTO x
    FROM dc_item d, item_wm_trigger_w c
    WHERE d.dept_i = c.dept_i
    AND d.class_i = c.class_i
    AND d.item_i = c.item_i;
    end;
    ERROR at line 1:
    ORA-06550: line 49, column 33:
    PLS-00306: wrong number or types of arguments in call to 'XMLAGG'
    ORA-06550: line 49, column 33:
    PL/SQL: ORA-00904: "XMLAGG": invalid identifier
    ORA-06550: line 4, column 1:
    PL/SQL: SQL Statement ignored
    When I run this query without the
    declare
    begin
    select....
    into...
    end
    construct, it's working perfectly fine.
    Any help would be greatly appreciated.
    Thanks,
    Nitin

    I think I confused you. The 'pre' tags are for this Oracle Forum ( not your code). If your code was formatted we can look at it better .
    For example, I have put your code in those tags(you won't see them), they are for the forum software to process.
    See, how I didn't lose the formatting?
    DECLARE
      x VARCHAR2(6000);
    BEGIN
      SELECT CAST(xmlelement("itemMaster",
                             xmlelement("itemNumber",
                                        lpad(d.dept_i, 3, 0) || lpad(d.class_i, 2, 0) ||
                                        lpad(d.item_i, 4, 0)),
                             xmlelement("itemDesc",
                                        NVL(d.ITEM_DESC_T,
                                            lpad(d.dept_i, 3, 0) ||
                                            lpad(d.class_i, 2, 0) ||
                                            lpad(d.item_i, 4, 0))),
                             xmlelement("paltSize", p1_test),
                             xmlelement("stdUOM", p1_test),
                             xmlelement("sellByDayQty", d.sell_by_day_q),
                             xmlelement("shflfUOM", p1_test),
                             xmlelement("minShflfDayQty", d.min_shflf_day_q),
                             xmlelement("itemCatgCode", NVL(d.dc_item_catg_c, 'GM')),
                             xmlelement("strgTempZoneCode",
                                        NVL(d.strg_tmpr_zone_c, '01')),
                             xmlelement("retailAmt", retl_a),
                             xmlelement("expireDateFlag", NVL(d.expire_date_f, 'N')),
                             xmlelement("randomWtFlag", NVL(d.rndm_wt_f, 'N')),
                             xmlelement("wetFlag", NVL(d.wet_f, 'N')),
                             xmlelement("areaCode", d.area_c),
                             xmlelement("vcpQty", d.vcp_q),
                             xmlelement("sspQty", d.ssp_q),
                             xmlelement("hndlTypeCode", d.hndl_type_c),
                             xmlelement("mstrPackTypeCode", d.mstr_pk_type_c),
                             xmlelement("mstrItemTypeCode",
                                        NVL(d.mstr_item_type_c, '00')),
                             xmlelement("sszCode", d.reg_ssz_excpt_c),
                             xmlelement("agriFlag", NVL(d.agrl_f, 'N')),
                             xmlelement("itemRankCode", d.item_rank_c),
                             xmlelement("hazardFlag", NVL(d.hazd_mtrl_f, 'N')),
                             xmlelement("createDate",
                                        to_char(d.create_d, 'MM-DD-YYYY HH24:MI:SS')),
                             xmlelement("updateDate",
                                        to_char(d.modf_ts, 'MM-DD-YYYY HH24:MI:SS')),
                             xmlelement("actvnDate",
                                        to_char(d.actvn_d, 'MM-DD-YYYY HH24:MI:SS')),
                             xmlelement("organicCode", d.ognc_c),
                             xmlelement("lotCntlFlag", NVL(d.lot_cntl_f, 'N')),
                             xmlelement("flammableFlag", NVL(d.flam_c, 'N')),
                             xmlelement("recordMode", c.action_c),
                             xmlelement("areaType", p1_test),
                             xmlelement("uoms",
                                        xmlelement("uom",
                                                   xmlelement("prodUOM", p1_test),
                                                   xmlelement("ratioDen", p1_test),
                                                   xmlelement("consldtRule", p1_test),
                                                   xmlelement("unitWtQty",
                                                              NVL(d.unit_wt_q, 1)),
                                                   xmlelement("vcpHeightQty",
                                                              NVL(d.vcp_ht_q, 1)),
                                                   xmlelement("vcpWidthQty",
                                                              NVL(d.vcp_wth_q, 1)),
                                                   xmlelement("vcpLengthQty",
                                                              NVL(d.vcp_lgth_q, 1)),
                                                   xmlelement("layerQty", p1_test))),
                             (SELECT xmlelement("aliases",
                                                xmlagg(xmlelement("upcCode",
                                                                  trunc(b.bar_code_i))
                                                       ORDER BY b.dept_i,
                                                       b.class_i,
                                                       b.item_i))
                                FROM dc_item_bar_code b, dc_item a
                               WHERE a.dept_i = b.dept_i
                                 AND a.class_i = b.class_i
                                 AND a.item_i = b.item_i
                                 AND a.dept_i = c.dept_i
                                 AND a.class_i = c.class_i
                                 AND a.item_i = c.item_i)) AS VARCHAR2(4000))
        INTO x
        FROM dc_item d, item_wm_trigger_w c
       WHERE d.dept_i = c.dept_i
         AND d.class_i = c.class_i
         AND d.item_i = c.item_i;
    END;
    /

  • IOException thrown in oracle.xml.parser.v2.XMLElement.readExternal() method

    Hi,
    I have a bpel process which takes in a particular xml format and does some processing asynchronously. I am calling this bpel process from a web application which uses axis web service to call this application.
    Everything works fine when the xml is small (around 10 to 15 kb). But once the xml gets huge(around 250 to 400 kb) error is thrown in bpel in the oracle.xml.parser.v2.XMLElement.readExternal() method. It seems like bpel is not able to reconstruct the object that it had written to some stream before. I learnt from some forum posts that this done for optimizing performance but I would like to know whether i have to tweak something here.
    Particularly what does this "java.io.IOException: Error in reading Namespace associated with the node" mean. Below is the error log
    10/01/05 20:40:51 java.io.IOException: Error in reading Namespace associated with the node
    10/01/05 20:40:51      at oracle.xml.parser.v2.XMLElement.readExternal(XMLElement.java:2954)
    10/01/05 20:40:51      at oracle.xml.parser.v2.XMLNode.readChildNodes(XMLNode.java:2842)
    10/01/05 20:40:51      at oracle.xml.parser.v2.XMLNode.readChildNodes(XMLNode.java:2843)
    10/01/05 20:40:51      at oracle.xml.parser.v2.XMLNode.readChildNodes(XMLNode.java:2843)
    10/01/05 20:40:51      at oracle.xml.parser.v2.XMLNode.readChildNodes(XMLNode.java:2843)
    10/01/05 20:40:51      at oracle.xml.parser.v2.XMLNode.readChildNodes(XMLNode.java:2843)
    10/01/05 20:40:51      at oracle.xml.parser.v2.XMLNode.readChildNodes(XMLNode.java:2843)
    10/01/05 20:40:51      at oracle.xml.parser.v2.XMLDocument.readExternal(XMLDocument.java:3394)
    10/01/05 20:40:51      at com.collaxa.cube.xml.dom.SDOMHelper.loadCompressedNormalDom(SDOMHelper.java:345)
    10/01/05 20:40:51      at com.collaxa.cube.xml.dom.SDOMHelper.load(SDOMHelper.java:135)
    10/01/05 20:40:51      at com.collaxa.cube.xml.dom.DOMUtil.loadDocument(DOMUtil.java:2266)
    10/01/05 20:40:51      at com.collaxa.cube.engine.delivery.DeliveryHelper.loadParts(DeliveryHelper.java:878)
    10/01/05 20:40:51      at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:515)
    10/01/05 20:40:51      at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:342)
    10/01/05 20:40:51      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10/01/05 20:40:51      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    10/01/05 20:40:51      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10/01/05 20:40:51      at java.lang.reflect.Method.invoke(Method.java:585)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
    10/01/05 20:40:51      at java.security.AccessController.doPrivileged(Native Method)
    10/01/05 20:40:51      at javax.security.auth.Subject.doAs(Subject.java:396)
    10/01/05 20:40:51      at com.evermind.server.ThreadState.runAs(ThreadState.java:648)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    10/01/05 20:40:51      at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    10/01/05 20:40:51      at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
    10/01/05 20:40:51      at CubeDeliveryBean_LocalProxy_4bin6i8.handleInvoke(Unknown Source)
    10/01/05 20:40:51      at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
    10/01/05 20:40:51      at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:138)
    10/01/05 20:40:51      at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
    10/01/05 20:40:51      at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
    10/01/05 20:40:51      at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
    10/01/05 20:40:51      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10/01/05 20:40:51      at java.lang.reflect.Method.invoke(Method.java:585)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
    10/01/05 20:40:51      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    10/01/05 20:40:51      at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    10/01/05 20:40:51      at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
    10/01/05 20:40:51      at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
    10/01/05 20:40:51      at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
    10/01/05 20:40:51      at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
    10/01/05 20:40:51      at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
    10/01/05 20:40:51      at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
    10/01/05 20:40:51      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
    10/01/05 20:40:51      at java.lang.Thread.run(Thread.java:595)
    10/01/05 20:40:51 0 - ORABPEL-00000
    Exception not handled by the Collaxa Cube system.
    An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "ORABPEL-09222
    Cannot deserialize DOM element.
    Failed to deserialize the DOM element from binary format, the document id 806601993018f2af:-5dd89d4f:125feeefac4:-7fbf. The exception reported is Error in reading Namespace associated with the node
         at com.collaxa.cube.xml.dom.SDOMHelper.loadCompressedNormalDom(SDOMHelper.java:355)
         at com.collaxa.cube.xml.dom.SDOMHelper.load(SDOMHelper.java:135)
         at com.collaxa.cube.xml.dom.DOMUtil.loadDocument(DOMUtil.java:2266)
         at com.collaxa.cube.engine.delivery.DeliveryHelper.loadParts(DeliveryHelper.java:878)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:515)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:342)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:648)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at CubeDeliveryBean_LocalProxy_4bin6i8.handleInvoke(Unknown Source)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:138)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Exception: ORABPEL-09222
    Cannot deserialize DOM element.
    Failed to deserialize the DOM element from binary format, the document id 806601993018f2af:-5dd89d4f:125feeefac4:-7fbf. The exception reported is Error in reading Namespace associated with the node
    Handled As: com.collaxa.cube.CubeException
    10/01/05 20:40:51 1 - ORABPEL-09222
    Cannot deserialize DOM element.
    Failed to deserialize the DOM element from binary format, the document id 806601993018f2af:-5dd89d4f:125feeefac4:-7fbf. The exception reported is Error in reading Namespace associated with the node
    <2010-01-05 20:40:51,381> <ERROR> <pmf_capability_domain.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "cube delivery": [com.collaxa.cube.CubeException: Exception not handled by the Collaxa Cube system.
    An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "ORABPEL-09222
    Cannot deserialize DOM element.
    Failed to deserialize the DOM element from binary format, the document id 806601993018f2af:-5dd89d4f:125feeefac4:-7fbf.  The exception reported is Error in reading Namespace associated with the node
         at com.collaxa.cube.xml.dom.SDOMHelper.loadCompressedNormalDom(SDOMHelper.java:355)
         at com.collaxa.cube.xml.dom.SDOMHelper.load(SDOMHelper.java:135)
         at com.collaxa.cube.xml.dom.DOMUtil.loadDocument(DOMUtil.java:2266)
         at com.collaxa.cube.engine.delivery.DeliveryHelper.loadParts(DeliveryHelper.java:878)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:515)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:342)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:648)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at CubeDeliveryBean_LocalProxy_4bin6i8.handleInvoke(Unknown Source)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:138)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Exception: ORABPEL-09222
    Cannot deserialize DOM element.
    Failed to deserialize the DOM element from binary format, the document id 806601993018f2af:-5dd89d4f:125feeefac4:-7fbf.  The exception reported is Error in reading Namespace associated with the node
    Handled As: com.collaxa.cube.CubeException
    ] -> [com.collaxa.cube.xml.dom.DOMException: Cannot deserialize DOM element.
    Failed to deserialize the DOM element from binary format, the document id 806601993018f2af:-5dd89d4f:125feeefac4:-7fbf.  The exception reported is Error in reading Namespace associated with the node
    ORABPEL-00000
    Exception not handled by the Collaxa Cube system.
    An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "ORABPEL-09222
    Cannot deserialize DOM element.
    Failed to deserialize the DOM element from binary format, the document id 806601993018f2af:-5dd89d4f:125feeefac4:-7fbf. The exception reported is Error in reading Namespace associated with the node
         at com.collaxa.cube.xml.dom.SDOMHelper.loadCompressedNormalDom(SDOMHelper.java:355)
         at com.collaxa.cube.xml.dom.SDOMHelper.load(SDOMHelper.java:135)
         at com.collaxa.cube.xml.dom.DOMUtil.loadDocument(DOMUtil.java:2266)
         at com.collaxa.cube.engine.delivery.DeliveryHelper.loadParts(DeliveryHelper.java:878)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:515)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:342)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:648)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at CubeDeliveryBean_LocalProxy_4bin6i8.handleInvoke(Unknown Source)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:138)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Exception: ORABPEL-09222

    I finally found the root cause of the solution. We are using axis serialization/deserialization at the client end to call the bpel service which works well for small xml. But mysteriously for larger xmls the deserialization fails at the server end when the incoming xml is being used. So we used the regular oracle java api to call the web service. This solved the problem.
    We could not find whether the problem lies with Oracle SOA suite 10.1.3.1 or Apache axis 2.0. But as of now these two seem to be incompatible for large xmls at the moment.
    Any pointers are welcome!

  • ClassCastException oracle.xml.parser.v2.XMLElement with correlation receive

    Hi,
    I am trying to run an asynchronous process that makes an invocation to an external WLI process, then gets an asynchronous receive from a second WLI process using correlation callbacks. We have two 10.1.3.3.0 servers, and the process works perfectly on the first server. The second server invokes WLI fine, and goes into a receive. But then when I call back into the BPEL process, I get the following error:
    Receive_1 (faulted)
    [2008/02/08 09:46:37] Waiting for "receive" from "client". Asynchronous callback.
    [2008/02/08 09:46:53] "ClassCastException" has been thrown.less
    oracle.xml.parser.v2.XMLElement
    It's the same process, calling the same external processes, with identical input/output. What does the error on the second server mean?
    Thank you,
    Nicholas

    Hi,
    I'm using BPEL process manager for calling a asynchronous web service,I can invoke the service from BPEL and the service is invoked correctly,but when I view the business process flow my process is stopped at receive state and doesn't pass it.
    Could anybody tell me if any thing should be set to receive a callback from an asynchronous web service to BPEL process?
    Thnx in advance,
    Nasim

  • Bpel-108-UsingXQuery $publisher - oracle.xml.parser.v2.XMLElement@8b8e58

    Hello,
    I am using Oracle SOA Suite 11.1.1.4.0 While executing the XQuery example bpel-108-UsingXQuery I am facing the following problem/error.
    The Xquery in the example is:
    xquery version "1.0";
    declare namespace ns0 = "http://example.com/bpel/books";
    declare namespace ns1 = "http://samples.otn.com/xquerysample";
    declare variable $category as node() external;
    declare variable $publisher as xs:string external;
    <bookReport>
    for $b in //ns0:BOOKS/ns0:ITEM
    where data($b/ns0:PUBLISHER) = $publisher
    order by string-length($b/TITLE) return
    <book>
    <author> { data($b/ns0:AUTHOR) } </author>
    <title> { data($b/ns0:TITLE) } </title>
    <price>{ data(doc("pricelist.xml")/ns1:pricelist/ns1:product[1]/ns1:price) }</price>
    <publisher>{ $publisher }</publisher>
    { $category }
    </book>
    </bookReport>
    The variable $publisher, declared in 'declare variable $publisher as xs:string external' shall have the value 'Associated Press' as this has been assigned in the BPEL but it has in fact the value 'oracle.xml.parser.v2.XMLElement@8b8e58'.
    The variable $category has the correct value.
    What is here wrong or is it a bug in 11.1.1.4.0 in the oracle.xml.parser.v2.XMLElement class.

    What a mess:
    org.w3c.Element element = (org.w3c.Element) payload.get("payload");
    private Document writeOraXMLtoDocument(org.w3c.Element payload) throws ParserConfigurationException, SAXException, IOException, TransformerException{
              ByteArrayInputStream inputStream = new ByteArrayInputStream(writeXMLToStream(new DOMSource(payload)).toByteArray());
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder =factory.newDocumentBuilder();
              return builder.parse(inputStream);
         private ByteArrayOutputStream writeXMLToStream(Source source) throws TransformerException {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    // Prepare the output file
    Result result = new StreamResult(out);
    // Write the DOM document to the file
    TransformerFactory x = TransformerFactory.newInstance();
    Transformer xformer = x.newTransformer();
    xformer.transform(source, result);
    return out;
    Note, that you have to use the oracle transformer located in the xmlparserv2.jar
    if it is not your default transformer , you have to set it at least for the above code by System.setProperty("javax.xml.transform.TransformerFactory","..classname...");

  • How do I check if the associated PageItem is there/exists from a XMLElement ?

    Hi,
    I have the following structure:
    Extension Builder 1.5;
    InDesign 5.0;
    Image (Rectangule Frame);
    XML tag associated with the Image.
    The following scenario:
    I do have an application that checks if this strucuture is available and intact, that is, the user has not deleted the tag (XMLElement) and/or the Rectangule Frame(PageItem);
    I do not want loop through allPageItems (the page should have many of them - more than 1000) and get the XMLElement;
    So, I loop over the XMLElements and get the associated PageItem through xmlElement.xmlContent property;
    The document images properties (image, epss, etc) never are populated (document.epss.length = 0);
    I can validate if the tag was deleted or untaged easy.
    The problem:
    User deletes the Image/Rectangule Frame (PageItem) and keep the xml tag (untag the XMLElement);
    The isValid property (xmlElement.isValid = true) is true;
    The associated PageItem becomes a Text and is valid as well;
    The question:
    How do I check if the associated PageItem is there/exists from a XMLElement ?
    Regards
    Marcos

    Found it, I think
        e.isControlDown()

  • [JS, CS3] Texts of a xmlElement

    I'm having a little thing here i dont understand. I found the below code on the forum, and have modyfied it very little.
    I use the script to find all xmlElements with a given name, and returning an array of the xmlElements.texts. Problem is, that for autotagged text in cells, xmlElements.texts is all text in the cell, exept for the first character, what am I doing wrong?
    Please see the comments to the two alerts in the script.
    function getItemsByXmlTag() {
        var xpath = ["//Cell"];
        var xmlItemMatches = getXmlMatches(xpath);
        function getXmlMatches(myXPath){
            var myXMLElements = new Array;
            var _items = new Array;
            var myRuleProcessor = app.xmlRuleProcessors.add(myXPath);
            try{
                var myMatchData = myRuleProcessor.startProcessingRuleSet(app.documents.item(0).xmlElements.item(0));
            while(myMatchData != undefined){
                var myElement = myMatchData.element;
                myXMLElements.push(myElement);
               alert(myElement.contents); //Always gives me the text contents
               alert(myElement.texts[0].contents); // Gives me the same as above, exept for all "autotagged" elements like "Cell". If its a cell containing some text, this alert gives me the text of the cell, but without the first character - what am i missing?
                _items.push(myElement.texts);
                myMatchData = myRuleProcessor.findNextMatch();
                myRuleProcessor.endProcessingRuleSet();
                myRuleProcessor.remove();
                return _items;
            catch (myError){
                myRuleProcessor.endProcessingRuleSet();
                myRuleProcessor.remove();
                throw myError;

    Hmm tested the unchanged script just now, seems the problem has been eleminated after a restart.
    Scratch that, the problem persist, could anyone try and run the script and tell me their results please
    Message was edited by: Thomas B. Nielsen

  • Error using DBMS_XMLQuery() with XMLElement().

    Select dbms_xmlquery.getXML('Select SYS_XMLAGG(
      2                                     XMLElement("SDI",
      3                                                 active_flag)) ' ||
      4                              'from Sdi s where s.sdi_num = 22261')
      5* From Dual
    SQL> /
    DBMS_XMLQUERY.GETXML('SELECTSYS_XMLAGG(XMLELEMENT("SDI",ACTIVE_FLAG))'||'FROMSDI
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Character
    ')' is not allowed in an XML tag name.</ERROR>
    SQL>

    please help.
    This is urgent
    No offence meant
    ~
    ~
    ~
    ~
    ~
    Select dbms_xmlquery.getXML('Select SYS_XMLAGG(
                                        XMLElement("SDI",
                                                  active_flag) )  ' ||
                                'from Sdi s where s.sdi_num = 22261')
    From Dual
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    Select dbms_xmlquery.getXML('Select SYS_XMLAGG(
                                        XMLElement("SDI",
                                                  active_flag) ) ppp ' ||
                                'from Sdi s where s.sdi_num = 22261')
    From Dual
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    Select dbms_xmlquery.getXML('Select SYS_XMLAGG(
                                        XMLElement("SDI",
                                                  active_flag) )  ' ||
                                'from Sdi s where s.sdi_num = 22261')
    From Dual
    ~
    ~
    ~
    ~
    Select dbms_xmlquery.getXML('Select SYS_XMLAGG(
                                        XMLElement('||"S^?,
                                                  active_flag) )  ' ||
                                'from Sdi s where s.sdi_num = 22261')
    From Dual
    ~
    ~
    ~
    Select dbms_xmlquery.getXML('Select SYS_XMLAGG(
                                        XMLElement("SDI",
                                                  active_flag) )  ' ||
                                'from Sdi s where s.sdi_num = 22261')
    From Dual
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    Select dbms_xmlquery.getXML('Select SYS_XMLAGG(
                                        XMLElement("SDI",
                                                  active_flag) )  ' ||
                                'from Sdi s where s.sdi_num = 22261')
    From Dual
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    Select DBMS_XMLQuery.getXML('Select ' ||
    'SYS_XMLAGG(XMLElement(NULL,active_flag)) ' ||
    'FROM SDI S where S.sdi_num = 22261 ')
    FROM DUAL
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    Select DBMS_XMLQuery.getXML('Select ' ||
    'SYS_XMLAGG(XMLElement(S,active_flag)) ' ||
    'FROM SDI S where S.sdi_num = 22261 ')
    FROM DUAL
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    Select DBMS_XMLQuery.getXML('Select ' ||
    'SYS_XMLAGG(XMLElement(S, active_flag)) ' ||
    'FROM SDI S where S.sdi_num = 22261 ')
    FROM DUAL
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    Select DBMS_XMLQuery.getXML('Select ' ||
    'SYS_XMLAGG(XMLElement("S", active_flag)) ' ||
    'FROM SDI S where S.sdi_num = 22261 ')
    FROM DUAL
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    Select DBMS_XMLQuery.getXML('Select ' ||
    'SYS_XMLAGG(XMLElement("S", active_flag)) ' ||
    'FROM SDI S where S.sdi_num = 22261 ')
    FROM DUAL
    ~
    ~
    ~
    Select DBMS_XMLQuery.getXML('Select ' ||
    'SYS_XMLAGG(XMLElement("S", active_flag)) ' ||
    'FROM SDI S where S.sdi_num = 22261 ')
    FROM DUAL
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    :q
      1  Select DBMS_XMLQuery.getXML('Select ' ||
      2  'SYS_XMLAGG(XMLElement("SDI", active_flag)) ' ||
      3  'FROM SDI S where S.sdi_num = 22261 ')
      4* FROM DUAL
    SQL> /
    DBMS_XMLQUERY.GETXML('SELECT'||'SYS_XMLAGG(XMLELEMENT("S",ACTIVE_FLAG))'||'FROMS
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Character
    ')' is not allowed in an XML tag name.</ERROR>
    SQL>
    same error
    AM I OVERLOOKING SOMETHING? DOES DBMS_XMLQUERY() NOT SUPPORT
    XMLFOREST()?

  • How to format generated XML using XMLELEMENT() my output is coming in a single line i want it to be in a XML format

    hi I am having problem in formatting XML file which I generated with xmlelement() when I execute it gives me putput in a single line
    is there any way that I got my output as a XML file HAS......

    That is expected behavior. PRETTY print(ing) is only needed for humans. XML Parsers don't need the XML to be pretty printed. If you open the XML file in a browser like Windows Explorer or Firefox, the browser will pretty print the output for you.
    In all, the "single line" output is done because of PERFORMANCE reasons (lack of unneeded end of line and CTRL line breaks etc)
    SELECT xmlelement("Employee Name", dummy) as "XML RESULT"
    FROM DUAL;
    <Employee Name>X</Employee Name>
    SELECT xmlelement("Employee Name", xmlelement("SurName", dummy)
                                     , xmlelement("LastName", dummy)
                     ) as "XML RESULT"
    FROM DUAL;
    <Employee Name><SurName>X</SurName><LastName>X</LastName></Employee Name>
    XMLSERIALIZE can pretty print the output if needed via INDENTation
    SELECT XMLSERIALIZE(CONTENT xmlelement("Employee Name", xmlelement("SurName", dummy), xmlelement("LastName", dummy)) as CLOB indent SIZE=1 )
    FROM DUAL;
    <Employee Name>
         <SurName>X</SurName>
         <LastName>X</LastName>
    </Employee Name>

  • How to get the text content of an XMLElement

    Hi,
    Here is a XML sample:
    <toto attrib1="titi">tata</toto>
    We want to get the text content "tata".
    Using an XMLElement (from the class "oracle.xml.parser.v2.XMLElement) to manipulate the element "toto", when we use the getNodeValue method, we always retrieve "null".
    So, what is wrong in our procedure and how to resolve this problem?
    Thanks in advance for your help
    Bye

    You need to get the child nodes of the Element and iterate until you find a node of type Node.TEXT_NODE.
    Elements don't have text content, they instead contain text node children.
    Just remember, too, that they can also contain comments, processing instructions, etc., in addition to the text you are looking for:
    <toto><!-- a comment --><?pi?>Tata</toto>

  • HOWTO: use table column value as tag name in XMLElement  (9iR2)

    Hi,
    maybe what I'm trying to do simply does not work, but here is my sample:
    select XMLElement(DUMMY, DUMMY).getClobVal( ) as SAMPLE
    from DUAL;
    returns the following XML
    <DUMMY>X</DUMMY>
    But what I want to get is
    <X>X</X>
    because "X" is the value of column "DUMMY" for table DUAL
    Is there a way to do this in PL/SQL XML-DB in Oracle 9i-R2?
    TIA,
    Stefan

    Do you mean something like this?
      1* select xmlelement(EVALNAME last_name, last_name) from employees
    SQL> /
    XMLELEMENT(EVALNAMELAST_NAME,LAST_NAME)
    <Abel>Abel</Abel>
    <Ande>Ande</Ande>
    <Atkinson>Atkinson</Atkinson>
    <Austin>Austin</Austin>
    <Baer>Baer</Baer>
    <Baida>Baida</Baida>
    <Banda>Banda</Banda>
    <Bates>Bates</Bates>
    <Bell>Bell</Bell>
    <Bernstein>Bernstein</Bernstein>
    <Bissot>Bissot</Bissot>
    <Bloom>Bloom</Bloom>
    <Bull>Bull</Bull>
    <Cabrio>Cabrio</Cabrio>
    <Cambrault>Cambrault</Cambrault>
    <Cambrault>Cambrault</Cambrault>
    <Chen>Chen</Chen>
    <Chung>Chung</Chung>
    <Colmenares>Colmenares</Colmenares>
    <Davies>Davies</Davies>
    .If you do then you're gonna have to upgrade to 10.2.0.2.
    In 10.2.0.1 you'll get...
    SQL> select xmlelement(EVALNAME last_name, last_name) from employees
      2  /
    ERROR:
    ORA-19039: Keyword EVALNAME reserved for future use
    no rows selected
    SQL>And earlier versions.... well, you probably won't even get that.

  • Formating XML formed with nested XMLELEMENT's

    Hi, maybe this is a silly question, could not find an answer though...
    When I use nested XMLELEMENT everything comes out in one long line, how can I do it so every level comes on a new line and with the apropriate indentation?
    Also .. I need to generate a different tag depending of the value of a field in the table, what is better DECODE or case statements, does it make any significant difference...It is something like this:
    select
    case cdsitfam
    when 1 then
    xmlelement("Situacion1").extract('/*')
    when 2 then
    xmlelement("Situacion2", xmlelement("NifC", cdnifc))
    else xmlelement("Situacion3").extract('/*')
    end somexml
    from BPNSo now in the second case it returns:
    <Situacion2><NifC>02545222L</NifC></Situacion2>and I would like it to be
    <Situacion2>
        <NifC>02545222L</NifC>
    </Situacion2>Not too terrible in this case I know but the nesting gets a lot more complicated..
    thanks in advance for any suggestions
    Message was edited by:
    Natalia

    From 10.2.0.2 there is also an option to use EVALNAME to give more dynamic element names:-
    SQL> create table mytest (id number, label varchar2(50));
    Table created.
    SQL> insert into mytest values (1, 'fred');
    1 row created.
    SQL> insert into mytest values (2, 'bob');
    1 row created.
    SQL> insert into mytest values (3, 'jim');
    1 row created.
    SQL> create table mydata (id number, dta varchar2(100));
    Table created.
    SQL> insert into mydata values (1, 'This is freds data');
    1 row created.
    SQL> insert into mydata values (2, 'This is bobs data');
    1 row created.
    SQL> insert into mydata values (3, 'This is jims data');
    1 row created.
    SQL> select xmlelement(evalname mytest.label, mydata.dta)
      2  from mytest, mydata
      3  where mytest.id = mydata.id;
    XMLELEMENT(EVALNAMEMYTEST.LABEL,MYDATA.DTA)
    <fred>This is freds data</fred>
    <bob>This is bobs data</bob>
    <jim>This is jims data</jim>
    SQL>And if using in PL/SQL, then the EVALNAME can evaluate from a variable.

  • Decode inside xmlelement???!!!!

    hello guys
    I have little bit problem by using XML inside sql query.
    XMLELEMENT("XXX", case r_econ_info_comp.country when lStateLocation then rr_econ_info_comp.juridical_form else null end),
    XMLELEMENT("YYY", case rr_econ_info_comp.country when lStateLocation then rr_econ_info_comp.juridical_form else null end),
    I would like to get the output just one of them, which depends on the variable StateLocation . i mean when i get for example the value of lStateLocation = 1 i want to output the xmlelement(XXX) and if i get any other value so to output xmlelement(YYY)
    i try it in this way
    Use Decode
    XMLELEMENT(Decode(lStateLocation, 1,"XXX","YYY"), case r_econ_info_comp.country when lStateLocation then rr_econ_info_comp.juridical_form else null end)
    but it does not work, becouse of comma missing.
    Some idea pls?
    Message was edited by:
    Samm

    All of these work in 11.1
    SQL> SELECT XMLELEMENT("rnode",
      2            CASE WHEN 'n' = 'Y'
      3                 THEN XMLELEMENT("XXX",1)
      4                 ELSE XMLELEMENT("YYY",1)
      5            END)
      6    FROM dual
      7  /
    XMLELEMENT("RNODE",CASEWHEN'N'='Y'THENXMLELEMENT("XXX",1)ELSEXMLELEMENT("YYY",1)
    <rnode><YYY>1</YYY></rnode>
    SQL> SELECT XMLELEMENT("rnode",
      2            DECODE('n', 'Y', XMLELEMENT("XXX",1), XMLELEMENT("YYY",1)))
      3    FROM dual
      4  /
    XMLELEMENT("RNODE",DECODE('N','Y',XMLELEMENT("XXX",1),XMLELEMENT("YYY",1)))
    <rnode><YYY>1</YYY></rnode>
    SQL> SELECT XMLELEMENT("rnode",
      2            XMLELEMENT(evalname case when 'Y' = 'Y' THEN 'XXX' ELSE 'YYY' END,1))
      3    FROM dual
      4  /
    XMLELEMENT("RNODE",XMLELEMENT(EVALNAMECASEWHEN'Y'='Y'THEN'XXX'ELSE'YYY'END,1))
    <rnode><XXX>1</XXX></rnode>
    SQL>

  • Error On Executing XMLelement Query

    Hi;
    When i try to execute a simple SQL I am getting error.
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    Connected as HR
    SQL>
    SQL> SELECT XMLELEMENT("Emp", XMLFOREST(e.employee_id, e.last_name, e.salary)) "Emp Element"
      2    FROM employees e
      3  /
    Emp Element
    <Emp><EMPLOYEE_ID>198</EMPLOYEE_ID><LAST_NAME>OConnell</LAST_NAME><SALARY>2600</
    <Object>
    <Emp><EMPLOYEE_ID>200</EMPLOYEE_ID><LAST_NAME>Whalen</LAST_NAME><SALARY>4400</SA
    <Object>
    <Emp><EMPLOYEE_ID>202</EMPLOYEE_ID><LAST_NAME>Fay</LAST_NAME><SALARY>6000</SALAR
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    Emp Element
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    Emp Element
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    Emp Element
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    Emp Element
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    <Object>
    SELECT XMLELEMENT("Emp", XMLFOREST(e.employee_id, e.last_name, e.salary)) "Emp Element"
      FROM employees e
    ORA-03114: not connected to ORACLE
    SQL> After executing query, my connection still alive. And when I look at the data of this query in tabular form, i see that <object> fields has <Value error> value.
    Is anyone have any ideas?
    Regards...

    No idea I'm afraid. I just tried it on my 10g (10.2.0.1) database HR schema and it worked fine...
      1  SELECT XMLELEMENT("Emp", XMLFOREST(e.employee_id, e.last_name, e.salary)) "Emp Element"
      2*     FROM employees e
    SQL> /
    Emp Element
    <Emp><EMPLOYEE_ID>198</EMPLOYEE_ID><LAST_NAME>OConnell</LAST_NAME><SALARY>2600</SALARY></Emp>
    <Emp><EMPLOYEE_ID>199</EMPLOYEE_ID><LAST_NAME>Grant</LAST_NAME><SALARY>2600</SALARY></Emp>
    <Emp><EMPLOYEE_ID>200</EMPLOYEE_ID><LAST_NAME>Whalen</LAST_NAME><SALARY>4400</SALARY></Emp>
    <Emp><EMPLOYEE_ID>201</EMPLOYEE_ID><LAST_NAME>Hartstein</LAST_NAME><SALARY>13000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>202</EMPLOYEE_ID><LAST_NAME>Fay</LAST_NAME><SALARY>6000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>203</EMPLOYEE_ID><LAST_NAME>Mavris</LAST_NAME><SALARY>6500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>204</EMPLOYEE_ID><LAST_NAME>Baer</LAST_NAME><SALARY>10000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>205</EMPLOYEE_ID><LAST_NAME>Higgins</LAST_NAME><SALARY>12000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>206</EMPLOYEE_ID><LAST_NAME>Gietz</LAST_NAME><SALARY>8300</SALARY></Emp>
    <Emp><EMPLOYEE_ID>100</EMPLOYEE_ID><LAST_NAME>King</LAST_NAME><SALARY>24000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>101</EMPLOYEE_ID><LAST_NAME>Kochhar</LAST_NAME><SALARY>17000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>102</EMPLOYEE_ID><LAST_NAME>De Haan</LAST_NAME><SALARY>17000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>103</EMPLOYEE_ID><LAST_NAME>Hunold</LAST_NAME><SALARY>9000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>104</EMPLOYEE_ID><LAST_NAME>Ernst</LAST_NAME><SALARY>6000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>105</EMPLOYEE_ID><LAST_NAME>Austin</LAST_NAME><SALARY>4800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>106</EMPLOYEE_ID><LAST_NAME>Pataballa</LAST_NAME><SALARY>4800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>107</EMPLOYEE_ID><LAST_NAME>Lorentz</LAST_NAME><SALARY>4200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>108</EMPLOYEE_ID><LAST_NAME>Greenberg</LAST_NAME><SALARY>12000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>109</EMPLOYEE_ID><LAST_NAME>Faviet</LAST_NAME><SALARY>9000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>110</EMPLOYEE_ID><LAST_NAME>Chen</LAST_NAME><SALARY>8200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>111</EMPLOYEE_ID><LAST_NAME>Sciarra</LAST_NAME><SALARY>7700</SALARY></Emp>
    <Emp><EMPLOYEE_ID>112</EMPLOYEE_ID><LAST_NAME>Urman</LAST_NAME><SALARY>7800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>113</EMPLOYEE_ID><LAST_NAME>Popp</LAST_NAME><SALARY>6900</SALARY></Emp>
    <Emp><EMPLOYEE_ID>114</EMPLOYEE_ID><LAST_NAME>Raphaely</LAST_NAME><SALARY>11000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>115</EMPLOYEE_ID><LAST_NAME>Khoo</LAST_NAME><SALARY>3100</SALARY></Emp>
    <Emp><EMPLOYEE_ID>116</EMPLOYEE_ID><LAST_NAME>Baida</LAST_NAME><SALARY>2900</SALARY></Emp>
    <Emp><EMPLOYEE_ID>117</EMPLOYEE_ID><LAST_NAME>Tobias</LAST_NAME><SALARY>2800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>118</EMPLOYEE_ID><LAST_NAME>Himuro</LAST_NAME><SALARY>2600</SALARY></Emp>
    <Emp><EMPLOYEE_ID>119</EMPLOYEE_ID><LAST_NAME>Colmenares</LAST_NAME><SALARY>2500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>120</EMPLOYEE_ID><LAST_NAME>Weiss</LAST_NAME><SALARY>8000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>121</EMPLOYEE_ID><LAST_NAME>Fripp</LAST_NAME><SALARY>8200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>122</EMPLOYEE_ID><LAST_NAME>Kaufling</LAST_NAME><SALARY>7900</SALARY></Emp>
    <Emp><EMPLOYEE_ID>123</EMPLOYEE_ID><LAST_NAME>Vollman</LAST_NAME><SALARY>6500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>124</EMPLOYEE_ID><LAST_NAME>Mourgos</LAST_NAME><SALARY>5800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>125</EMPLOYEE_ID><LAST_NAME>Nayer</LAST_NAME><SALARY>3200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>126</EMPLOYEE_ID><LAST_NAME>Mikkilineni</LAST_NAME><SALARY>2700</SALARY></Emp>
    <Emp><EMPLOYEE_ID>127</EMPLOYEE_ID><LAST_NAME>Landry</LAST_NAME><SALARY>2400</SALARY></Emp>
    <Emp><EMPLOYEE_ID>128</EMPLOYEE_ID><LAST_NAME>Markle</LAST_NAME><SALARY>2200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>129</EMPLOYEE_ID><LAST_NAME>Bissot</LAST_NAME><SALARY>3300</SALARY></Emp>
    <Emp><EMPLOYEE_ID>130</EMPLOYEE_ID><LAST_NAME>Atkinson</LAST_NAME><SALARY>2800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>131</EMPLOYEE_ID><LAST_NAME>Marlow</LAST_NAME><SALARY>2500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>132</EMPLOYEE_ID><LAST_NAME>Olson</LAST_NAME><SALARY>2100</SALARY></Emp>
    <Emp><EMPLOYEE_ID>133</EMPLOYEE_ID><LAST_NAME>Mallin</LAST_NAME><SALARY>3300</SALARY></Emp>
    <Emp><EMPLOYEE_ID>134</EMPLOYEE_ID><LAST_NAME>Rogers</LAST_NAME><SALARY>2900</SALARY></Emp>
    <Emp><EMPLOYEE_ID>135</EMPLOYEE_ID><LAST_NAME>Gee</LAST_NAME><SALARY>2400</SALARY></Emp>
    <Emp><EMPLOYEE_ID>136</EMPLOYEE_ID><LAST_NAME>Philtanker</LAST_NAME><SALARY>2200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>137</EMPLOYEE_ID><LAST_NAME>Ladwig</LAST_NAME><SALARY>3600</SALARY></Emp>
    <Emp><EMPLOYEE_ID>138</EMPLOYEE_ID><LAST_NAME>Stiles</LAST_NAME><SALARY>3200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>139</EMPLOYEE_ID><LAST_NAME>Seo</LAST_NAME><SALARY>2700</SALARY></Emp>
    <Emp><EMPLOYEE_ID>140</EMPLOYEE_ID><LAST_NAME>Patel</LAST_NAME><SALARY>2500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>141</EMPLOYEE_ID><LAST_NAME>Rajs</LAST_NAME><SALARY>3500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>142</EMPLOYEE_ID><LAST_NAME>Davies</LAST_NAME><SALARY>3100</SALARY></Emp>
    <Emp><EMPLOYEE_ID>143</EMPLOYEE_ID><LAST_NAME>Matos</LAST_NAME><SALARY>2600</SALARY></Emp>
    <Emp><EMPLOYEE_ID>144</EMPLOYEE_ID><LAST_NAME>Vargas</LAST_NAME><SALARY>2500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>145</EMPLOYEE_ID><LAST_NAME>Russell</LAST_NAME><SALARY>14000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>146</EMPLOYEE_ID><LAST_NAME>Partners</LAST_NAME><SALARY>13500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>147</EMPLOYEE_ID><LAST_NAME>Errazuriz</LAST_NAME><SALARY>12000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>148</EMPLOYEE_ID><LAST_NAME>Cambrault</LAST_NAME><SALARY>11000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>149</EMPLOYEE_ID><LAST_NAME>Zlotkey</LAST_NAME><SALARY>10500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>150</EMPLOYEE_ID><LAST_NAME>Tucker</LAST_NAME><SALARY>10000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>151</EMPLOYEE_ID><LAST_NAME>Bernstein</LAST_NAME><SALARY>9500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>152</EMPLOYEE_ID><LAST_NAME>Hall</LAST_NAME><SALARY>9000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>153</EMPLOYEE_ID><LAST_NAME>Olsen</LAST_NAME><SALARY>8000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>154</EMPLOYEE_ID><LAST_NAME>Cambrault</LAST_NAME><SALARY>7500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>155</EMPLOYEE_ID><LAST_NAME>Tuvault</LAST_NAME><SALARY>7000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>156</EMPLOYEE_ID><LAST_NAME>King</LAST_NAME><SALARY>10000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>157</EMPLOYEE_ID><LAST_NAME>Sully</LAST_NAME><SALARY>9500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>158</EMPLOYEE_ID><LAST_NAME>McEwen</LAST_NAME><SALARY>9000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>159</EMPLOYEE_ID><LAST_NAME>Smith</LAST_NAME><SALARY>8000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>160</EMPLOYEE_ID><LAST_NAME>Doran</LAST_NAME><SALARY>7500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>161</EMPLOYEE_ID><LAST_NAME>Sewall</LAST_NAME><SALARY>7000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>162</EMPLOYEE_ID><LAST_NAME>Vishney</LAST_NAME><SALARY>10500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>163</EMPLOYEE_ID><LAST_NAME>Greene</LAST_NAME><SALARY>9500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>164</EMPLOYEE_ID><LAST_NAME>Marvins</LAST_NAME><SALARY>7200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>165</EMPLOYEE_ID><LAST_NAME>Lee</LAST_NAME><SALARY>6800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>166</EMPLOYEE_ID><LAST_NAME>Ande</LAST_NAME><SALARY>6400</SALARY></Emp>
    <Emp><EMPLOYEE_ID>167</EMPLOYEE_ID><LAST_NAME>Banda</LAST_NAME><SALARY>6200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>168</EMPLOYEE_ID><LAST_NAME>Ozer</LAST_NAME><SALARY>11500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>169</EMPLOYEE_ID><LAST_NAME>Bloom</LAST_NAME><SALARY>10000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>170</EMPLOYEE_ID><LAST_NAME>Fox</LAST_NAME><SALARY>9600</SALARY></Emp>
    <Emp><EMPLOYEE_ID>171</EMPLOYEE_ID><LAST_NAME>Smith</LAST_NAME><SALARY>7400</SALARY></Emp>
    <Emp><EMPLOYEE_ID>172</EMPLOYEE_ID><LAST_NAME>Bates</LAST_NAME><SALARY>7300</SALARY></Emp>
    <Emp><EMPLOYEE_ID>173</EMPLOYEE_ID><LAST_NAME>Kumar</LAST_NAME><SALARY>6100</SALARY></Emp>
    <Emp><EMPLOYEE_ID>174</EMPLOYEE_ID><LAST_NAME>Abel</LAST_NAME><SALARY>11000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>175</EMPLOYEE_ID><LAST_NAME>Hutton</LAST_NAME><SALARY>8800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>176</EMPLOYEE_ID><LAST_NAME>Taylor</LAST_NAME><SALARY>8600</SALARY></Emp>
    <Emp><EMPLOYEE_ID>177</EMPLOYEE_ID><LAST_NAME>Livingston</LAST_NAME><SALARY>8400</SALARY></Emp>
    <Emp><EMPLOYEE_ID>178</EMPLOYEE_ID><LAST_NAME>Grant</LAST_NAME><SALARY>7000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>179</EMPLOYEE_ID><LAST_NAME>Johnson</LAST_NAME><SALARY>6200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>180</EMPLOYEE_ID><LAST_NAME>Taylor</LAST_NAME><SALARY>3200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>181</EMPLOYEE_ID><LAST_NAME>Fleaur</LAST_NAME><SALARY>3100</SALARY></Emp>
    <Emp><EMPLOYEE_ID>182</EMPLOYEE_ID><LAST_NAME>Sullivan</LAST_NAME><SALARY>2500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>183</EMPLOYEE_ID><LAST_NAME>Geoni</LAST_NAME><SALARY>2800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>184</EMPLOYEE_ID><LAST_NAME>Sarchand</LAST_NAME><SALARY>4200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>185</EMPLOYEE_ID><LAST_NAME>Bull</LAST_NAME><SALARY>4100</SALARY></Emp>
    <Emp><EMPLOYEE_ID>186</EMPLOYEE_ID><LAST_NAME>Dellinger</LAST_NAME><SALARY>3400</SALARY></Emp>
    <Emp><EMPLOYEE_ID>187</EMPLOYEE_ID><LAST_NAME>Cabrio</LAST_NAME><SALARY>3000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>188</EMPLOYEE_ID><LAST_NAME>Chung</LAST_NAME><SALARY>3800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>189</EMPLOYEE_ID><LAST_NAME>Dilly</LAST_NAME><SALARY>3600</SALARY></Emp>
    <Emp><EMPLOYEE_ID>190</EMPLOYEE_ID><LAST_NAME>Gates</LAST_NAME><SALARY>2900</SALARY></Emp>
    <Emp><EMPLOYEE_ID>191</EMPLOYEE_ID><LAST_NAME>Perkins</LAST_NAME><SALARY>2500</SALARY></Emp>
    <Emp><EMPLOYEE_ID>192</EMPLOYEE_ID><LAST_NAME>Bell</LAST_NAME><SALARY>4000</SALARY></Emp>
    <Emp><EMPLOYEE_ID>193</EMPLOYEE_ID><LAST_NAME>Everett</LAST_NAME><SALARY>3900</SALARY></Emp>
    <Emp><EMPLOYEE_ID>194</EMPLOYEE_ID><LAST_NAME>McCain</LAST_NAME><SALARY>3200</SALARY></Emp>
    <Emp><EMPLOYEE_ID>195</EMPLOYEE_ID><LAST_NAME>Jones</LAST_NAME><SALARY>2800</SALARY></Emp>
    <Emp><EMPLOYEE_ID>196</EMPLOYEE_ID><LAST_NAME>Walsh</LAST_NAME><SALARY>3100</SALARY></Emp>
    <Emp><EMPLOYEE_ID>197</EMPLOYEE_ID><LAST_NAME>Feeney</LAST_NAME><SALARY>3000</SALARY></Emp>
    107 rows selected.
    SQL>

  • How To Store XML Fragments Using Functions Such As XMLElement

    Hi
    Not sure what I am missing. I wish to store XML fragments in variables so can pass around and concatenate with other fragments to make final XML document. Even before attempting to concatenate XML fragments, I am struggling to store any XML fragment in a variable. I am trying to use simple functions such as XMLElement to generate XML so can store in variable. I have seen many examples of XMLElement in SQL select statement. Can XMLElement be used in plsql? XMLElement says it returns value of type XMLType. Functions such as XMLElement make generating XML easier than creating all tags manually.
    Below is simple example that demonstrates what I would like to do. I would like to be able to pass the XML fragment as either XMLType or clob. I receive error saying PLS-00201: identifier 'XMLELEMENT' must be declared
    declare
    vTheData XMLType;
    vTheDataClob clob;
    begin
      vTheData:= XMLelement("empno",'1234567');
      vTheDataClob:= xmlelement("empno",'1234567').getclobval();
    end;
    Where as I can use below, but surely don't have to use select into from dual method. I just expect can use XMLElement function in plsql same as sql, such as most other functions eg length, rtrim etc.
    declare
    vTheData XMLType;
    vTheDataClob clob;
    begin
      select xmlelement("empno",'1234567')
      into vTheData
      from dual;
      select xmlelement("empno",'1234567').getclobval()
      into vTheDataClob
      from dual;
    end;
    Hope this makes sense.
    Thanks

    Having said that, is there a more elegant way to achieve below. That is populate two XML fragments and concatenate together.
    Sure, why not just only one statement?
    select XMLConcat(
             XMLElement( ... )
           , XMLElement( ... )
    into vTheResult
    from dual;
    As a second question, is it better to build and pass XML fragments as XMLType or clob?
    I would say stay with XMLType but it depends on your requirement.
    I generally avoid passing around pieces of data, SQL/XML functions are powerful in the way they can be used with set operations, so using them in a piecewise approach kinda negates what they're for.

Maybe you are looking for

  • Is it possible to call the TEXT EDITOR in a program?

    Hi, I want a function module which will popup a text editor where the user can write some text and then i can use this text for further processing. do we have any such function modules or text editor which i can call from the program to take long tex

  • HT201303 Forgot security question answers!

    My brother set up the security questions on my account and forgot them but never told me the answers. What can i do to change them as i cant rent a film with out knowing the answers. Thanks

  • Table Fields of Product Analysis

    Hi All, I'm working on Product Analysis report for Inspection Lot. Unable to find the tables and fields for inspection parameters: 1.Valid till date field 2.weight 3.FFA 4.BCAR 5.DOBI Thank You,

  • Disable multiple logons

    I am implementing PHD into our office. I am wanting to disable the ability to logon to multiple devices at the same time to remove any syncing issues. Any know if this is possible. I can't seem to find any options in WGM to do this. Thanks

  • Required Authorization for BI Administrator

    Hello I would like to know, what kind of authorization is required for a BI Administrator on ECC 6.0.  I'm keep gettting ERROR as Source system DEVCLNT510: No authorization for remote activation of DataSources Also, I don't have access to RSO2 transa