How because result of xml using PL/SQL

Hi all.

I got a response from the web service xml, and I must parseit using PL/SQL.

This is my XML:

" < s: Envelope = xmlns:s ' http://www.w3.org/2003/05/soap-envelope "" xmlns: a = " " http://www.w3.org/2005/08/addressing ">

< s:Header >

< a: Action = '1' s:mustUnderstand > http://tempuri.org/IPagosLineaService/ProcesarComunicacionOnlineResponse < / a: Action >

< / s:Header >

< Body >

" < ProcesarComunicacionOnlineResponse xmlns =" http://tempuri.org/ ">

" < ProcesarComunicacionOnlineResult xmlns: b = ' http://schemas.DataContract.org/2004/07/SiGe.Servicios.Sanaa "xmlns:i =" " http://www.w3.org/2001/XMLSchema-instance « >

< b:REFGLOBAL > 201510533758 < / b:REFGLOBAL >

< b:IMPTOTAL > 357.09 < / b:IMPTOTAL >

< b:IMPMORA > 0 < / b:IMPMORA >

< b:TIPOIMP > 67 < / b:TIPOIMP >

< b:MONEDA > 76 < / b:MONEDA >

< b:FETPAG > 2015-11-30 T 00: 00:00 < / b:FETPAG >

< b:CLIENTE > 61998 < / b:CLIENTE >

< b:NOMBRE > MARIO ALFONSO PINEDA < / b:NOMBRE >

< b:BANCO > 7 < / b:BANCO >

< b:CAJERO > 1017 < / b:CAJERO >

B1234 < b:BCID > < / b:BCID >

< b:AVISOS >

< b:AVISO >

< b:REFPAGO > 201510533758 < / b:REFPAGO >

< b:TIPOAVISO > 80 < / b:TIPOAVISO >

< b:IMPTOTAL > 357.09 < / b:IMPTOTAL >

< b:IMPMORA > 0.00 < / b:IMPMORA >

< b:IMPMIN > 357.09 < / b:IMPMIN >

< b:TIPOIMP > 67 < / b:TIPOIMP >

< b:MONEDA > 76 < / b:MONEDA >

< b:CODIGO_COMERCIAL > 2535510971 < / b:CODIGO_COMERCIAL >

< b:CLIENTE > 61998 < / b:CLIENTE >

< b:NOMBRE > MARIO ALFONSO PINEDA < / b:NOMBRE >

< b:DIRECCION > BL E RETORNO 7Y8 N7302 COL NAKED < / b:DIRECCION >

< b:RECIBOS >

< b:RECIBO >

< b:CODIGOFACT > 201510533758 < / b:CODIGOFACT >

< b:FECHAFACT > 2015 - 11 - 11 T 00: 00:00 < / b:FECHAFACT >

< b:FECHAVTO > 2015-11-30 T 00: 00:00 < / b:FECHAVTO >

< b:IMPTOTAL > 357.09 < / b:IMPTOTAL >

< b:IMPMORA > 0.00 < / b:IMPMORA >

< b:TIPOIMP > 67 < / b:TIPOIMP >

< b:MONEDA > 76 < / b:MONEDA >

< b:EJERCICIO > 2015 < / b:EJERCICIO >

< b:PERIODO > 10 < / b:PERIODO >

< b:LECTANT > 611 < / b:LECTANT >

< b:FECHLECTANT > 2015 - 10-01 T 00: 00:00 < / b:FECHLECTANT >

< b:LECTACT > 728 < / b:LECTACT >

< b:FECHLECTACT > 2015 - 11 - 02 T 00: 00:00 < / b:FECHLECTACT >

< b:CONSUMO > 31 < / b:CONSUMO >

< b:NUMSERIEAM > 5884 < / b:NUMSERIEAM >

< b:CODIGO_COMERCIAL > 2535510971 < / b:CODIGO_COMERCIAL >

< b:CATEGORIA > DOMESTICA < / b:CATEGORIA >

< b:LINEAS_DETALLE >

< b:DETALLE >

Alcantarillado Sanitario < b:DESCRIPCION > < / b:DESCRIPCION >

< b:CANTIDAD > 31 < / b:CANTIDAD >

< b:UNIDMED > M3 < / b:UNIDMED >

< b: MATTER > 57,12 < / b: MATTER >

< / b:DETALLE >

< b:DETALLE >

Mantenimiento Medidor < b:DESCRIPCION > < / b:DESCRIPCION >

< b:CANTIDAD > 1 < / b:CANTIDAD >

< b:UNIDMED > M3 < / b:UNIDMED >

< b: MATTER > 1.50 < / b: MATTER >

< / b:DETALLE >

< b:DETALLE >

Costo fijo por Conexion < b:DESCRIPCION > < / b:DESCRIPCION >

< b:CANTIDAD > 1 < / b:CANTIDAD >

< b:UNIDMED > M3 < / b:UNIDMED >

< b: MATTER > 70.00 < / b: MATTER >

< / b:DETALLE >

< b:DETALLE >

Drinking Agua < b:DESCRIPCION > < / b:DESCRIPCION >

< b:CANTIDAD > 31 < / b:CANTIDAD >

< b:UNIDMED > M3 < / b:UNIDMED >

< b: ANY > 228,47 < / b: MATTER >

< / b:DETALLE >

< b:DETALLE >

Jubilado Descuento < b:DESCRIPCION > < / b:DESCRIPCION >

< b:CANTIDAD > 1 < / b:CANTIDAD >

< b:UNIDMED > M3 < / b:UNIDMED >

< b: MATTER > 0.00 < / b: MATTER >

< / b:DETALLE >

< b:DETALLE >

Interested por Mora < b:DESCRIPCION > < / b:DESCRIPCION >

< b:CANTIDAD > 1 < / b:CANTIDAD >

< b:UNIDMED > M3 < / b:UNIDMED >

< b: MATTER > 0.00 < / b: MATTER >

< / b:DETALLE >

< b:DETALLE >

Pendiente Saldo < b:DESCRIPCION > < / b:DESCRIPCION >

< b:CANTIDAD > 1 < / b:CANTIDAD >

< b:UNIDMED > M3 < / b:UNIDMED >

< b: MATTER > 0.00 < / b: MATTER >

< / b:DETALLE >

< b:DETALLE >

Convenios < b:DESCRIPCION > < / b:DESCRIPCION >

< b:CANTIDAD > 1 < / b:CANTIDAD >

< b:UNIDMED > M3 < / b:UNIDMED >

< b: MATTER > 0.00 < / b: MATTER >

< / b:DETALLE >

< / b:LINEAS_DETALLE >

< / b:RECIBO >

< / b:RECIBOS >

< / b:AVISO >

< / b:AVISOS >

< / ProcesarComunicacionOnlineResult >

< / ProcesarComunicacionOnlineResponse >

< / Body >

< / s: Envelope >

It's my PL/SQL code:

create or replace

procedure SANAA_CONSULTA (Operación in varchar2,

codigocomercial in varchar2,

Banco in varchar2,

cajero in varchar2,

BCID in varchar2,

p_recordset to sys_refcursor) as

soap_request varchar2 (32000);

CLOB soap_respond; -VARCHAR2 (32000);

-soap_respond varchar2 (30000);

http_req utl_http.req;

http_resp utl_http.resp;

RESP XMLType.

CLOB resp1;

-resp1 varchar2 (30000);

resp2 varchar2 (30000);

soap_err exception;

v_code varchar2 (200);

v_msg varchar2 (1800);

number of v_len;

v_txt varchar2 (32767).

I have integer;

tablaTemp varchar2 (2000);

tablaTemp2 varchar2 (2000);

tablaTemp3 varchar2 (2000);

tablaTemp4 varchar2 (2000);

tablaTemp5 varchar2 (2000);

tablaTemp6 varchar2 (2000);

CLOB vCampo;

buffer varchar2 (32767).

Start

" soap_request: = ' < envelope soap: xmlns:soap = ' http://www.w3.org/2003/05/soap-envelope "xmlns:tem =" " http://tempuri.org/ "xmlns:sige =" " http://schemas.DataContract.org/2004/07/SiGe.Servicios.Sanaa « >' ||

' < soap: Header / > '.

"< soap: Body >" |

"< tem:ProcesarComunicacionOnline >" |

' <!-in option: - > ' |

"< tem:msg >" |

' <!-in option: - > ' |

"< sige:OPERACION >" | Operación | "< / sige:OPERACION > ' |

"< sige:CODIGO_COMERCIAL >" | codigocomercial | "< / sige:CODIGO_COMERCIAL > ' |

"< sige:BANCO >" | Banco | "< / sige:BANCO > ' |

' <!-in option: - > ' |

"< sige:CAJERO >" | cajero | "< / sige:CAJERO > ' |

' <!-in option: - > ' |

"< sige:BCID >" | BCID | "< / sige:BCID > ' |

' < / tem:msg > ' |

' < / tem:ProcesarComunicacionOnline > ' |

' < / soap: Body > ' |

' < / envelope soap: > ';

http_req: = utl_http.begin_request ("http://181.210.29.198:8099/PagosLineaGGS/sige.servicios.sanaa.Pagoslineaservice.svc', ")

"MESSAGE."

"(HTTP / 1,1');"

Utl_http.set_header (http_req, 'Content-Type', ' text/xml "");

Utl_http.set_header (http_req, "Content-Length", LENGTH (soap_request) ");

Utl_http.set_header (http_req,

"SOAPAction",.

                      ' http://tempuri.org/IPagosLineaService/ProcesarComunicacionOnline');

Utl_http.write_text (http_req, soap_request);

http_resp: = utl_http.get_response (http_req);

DBMS_LOB. CREATETEMPORARY (vCampo, true);

loop

Start

Utl_http.READ_TEXT (http_resp, buffer, 32767);

If the buffer is not null

and length (buffer) > 0

then

DBMS_LOB. WriteAppend (vCampo, length (buffer), buffer);

end if;

exception

while others then

"exit";

end;

end loop;

-utl_http.read_text (http_resp, soap_respond);

Utl_http.end_response (http_resp);

-RESP: = XMLType.createXML (soap_respond);

-resp1: = resp.extract('/*').getStringVal ();

Open the p_recordset for

with XML in the form

(select XMLTYPE (vCampo) as double OBJECT_VALUE)

-(select XMLTYPE (resp1) in the OBJECT_VALUE of the double)

-Select

-Select *.

Select the amount Descripción, unidmed, matter

-Select *.

XML,.

XMLTABLE)

XmlNamespaces)

            ' http://schemas.DataContract.org/2004/07/SiGe.Servicios.Sanaa ' « b »

          , ' http://www.w3.org/2003/05/soap-envelope/ ' as "s"

, by default ' http://tempuri.org/ '

)

-'/ / b:DETALLE'

-, ' / ProcesarComunicacionOnlineResponse/ProcesarComunicacionOnlineResult / b:AVISOS / b:AVISO / b:RECIBOS / b:RECIBO / b:LINEAS_DETALLE / b:DETALLE'

, ' / s: Envelope / Body/ProcesarComunicacionOnlineResponse/ProcesarComunicacionOnlineResult / b:AVISOS / b:AVISO / b:RECIBOS / b:RECIBO / b:LINEAS_DETALLE / b:DETALLE'

by the way the OBJECT_VALUE columns

Descripción varchar2 (80) path "DESCRIPCIÓN."

amount varchar2 (10) PATH "AMOUNT."

unidmed varchar2 (10) path "UNIDMED."

VARCHAR2 (2) any PATH 'MATTER');

end SANAA_CONSULTA;

But I get the following error:

ORA-31011: Fallo en el Análisis XML ORA-19202: Se ha during an aforementioned LPX-00229 el error: input source is empty of XML ORA-06512: en "SYS. XMLTYPE", linea 272 ORA-06512: linea en 1

Can someone give me a solution?

Thank you in advance.

You have specified namespace "s" wrongly, and you are not referencing the namespace "b" in your columns:

SQL > ed
A written file afiedt.buf

1 with t (xml) as (select xmltype (to_clob (')))
"" 2 http://www.w3.org/2003/05/soap-envelope "xmlns: a = 'http://www.w3.org/2005/08/addressing' > '.
3
4 http://tempuri.org/IPagosLineaService/ProcesarComunicacionOnlineResponse
5

6


"7 http://tempuri.org/" >
"' 8 http://schemas.datacontract.org/2004/07/sige.Servicios.Sanaa" xmlns:i = "http://www.w3.org/2001/XMLSchema-instance" > ".
9 201510533758
10 357.09
11              0
12              67
13              76
14 2015-11 - 30 T 00: 00:00
15 61998
16 MARIO ALFONSO PINEDA
17              7
18              1017
B1234 19
20
21
22 201510533758
23                    80
24                    357.09
25                    0.00
26                    357.09
27                    67
28                    76
29 2535510971
30                    61998
31 MARIO ALFONSO PINEDA
32 BL E RETORNO 7Y8 N7302 COL NAKED

33
34
35 201510533758
36 2015-11 - 11T 00: 00:00
37 2015-11 - 30 T 00: 00:00
38                          357.09
39                          0.00
40                          67
41                          76
42                          2015
43                          10
44                          611
45 2015-10 - 01 T 00: 00:00
46                          728
47 2015-11 - 02T 00: 00:00
48                          31
49                          5884
50 2535510971
51 DOMESTICA
52                          ')|| TO_CLOB (')
53
54 Alcantarillado Sanitario
55                                31
56                                M3
57                                57.12
58

59
60 Mantenimiento Medidor
61                                1
62                                M3
63                                1.50
64

65
66 Costo fijo por Conexi¾n
67                                1
68                                M3
69                                70.00
70

71
72 of drinking water
73                                31
74                                M3
75                                228.47
76

77
78 Jubilado Descuento
79                                1
80                                M3

81                                0.00
82
83
84 of interested por Mora
85                                1
86                                M3
87                                0.00
88

89
90 Saldo Pendiente
91                                1
92                                M3
93                                0.00
94

95
96 Convenios
97                                1
98                                M3
99                                0.00
100

101
102
103
104
105
106
107
108
109 ')) double)
110. -
111 end of sample data
112-
113 select x.*
114 t
115, XMLTABLE (xmlnamespaces ('http://schemas.datacontract.org/2004/07/sige.Servicios.Sanaa' 'b'))
116, "http://www.w3.org/2003/05/soap-envelope" as "s".
117, by default 'http://tempuri.org/'.
118                               )
119,'/ s: Envelope / Body/ProcesarComunicacionOnlineResponse/ProcesarComunicacionOnlineResult / b:AVISOS / b:AVISO / b:RECIBOS / b:RECIBO / b:LINEAS_DETALLE / b:DETALLE'
passage of 120 xml
path of varchar2 (80) 121 Descripción columns '. / b:DESCRIPCION',
122 varchar2 (10) amount WAY '. / b:CANTIDAD',
123 unidmed varchar2 (10) PATH '. / b:UNIDMED',
124 regardless of PATH number '. / b: MATTER '
125*               ) x
SQL > /.

DESCRIPCIÓN AMOUNT UNIDMED MATTER
-------------------------------------------------------------------------------- ---------- ---------- ----------
Alcantarillado Sanitario 31 M3 57.12
Mantenimiento Medidor 1 1.5 M3
Costo fijo por Conexi¾n 1 M3 70
Agua Potable                                                                     31         M3         228.47
1 Jubilado descuento M3 0
Intereses por Mora                                                               1          M3         0
Saldo Pendiente                                                                  1          M3         0
Convenios                                                                        1          M3         0

8 selected lines.

SQL >

Tags: Database

Similar Questions

  • How to train a xml using a comma separated string in Xquery

    Hi all

    In my application, I need to write an Xquery query that should be an xml document. Admission to the XQuery function is an xml with an element that has the strings separated by commas. For

    example of

    < root >
    < StringComma > Hi, Hello, welcome < / StringComma >
    < / root >

    I need form an xml in such a way that it should have as many tags as the strings in < StringComma > element of the foregoing. For example, is what I want

    < Root1 >
    < String1 > Hello < / String1 >
    < String2 > Hello < / String2 >
    Welcome < String3 > < / String3 >
    < / Root1 >

    something like that. How could we do it using XQuery. Kindly help me in this.


    Thank you.

    Hello

    You can do it like this:

    declare variable $input := document{ Hi,Hello,Welcome };
    
    
    {
      for $i at $pos in fn:tokenize($input/Root/StringComma, ",")
      return element {fn:concat("String", $pos)} {$i}
    }
    
    
  • How to retrieve multiple records in XML using PL/SQL with XE 10 g

    Hi all

    I need your advice, if you please.
    I have an object CLOB as a result of a Web Service, I need to analyze. I use the XE version, XQuery is not for me, I get SYS. Exception DBMS_XQUERYINT.

    I tried to use the snippet, but it looks like I'm doing something wrong there. Please tell me what should I change?

    (1) I have a temporary table with id and xmltype
    (2) I have tested that the example data in the table
    (3) I get nothing no matter if I use,'/ modifyPlannedItemStatus/days [1] / day_of_week_order "or simply,'/ modifyPlannedItemStatus/days [1] / day_of_week_order'."

    Thanks in advance


    DECLARE
    my_xml XMLTYPE.
    my_clob CLOB: =' <? XML version = "1.0" encoding = "UTF-8" standalone = 'no '? >
    < mgns1:modifyPlannedItemStatus xmlns:mgns1 = "http://www.mart-sw.co.uk/library" >
    < days >
    A < day_of_week_code > < / day_of_week_code >
    < day_of_week_order > 1 < / day_of_week_order >
    Monday < day_of_week_name > < / day_of_week_name >
    < / days >
    < days >
    < day_of_week_code > B < / day_of_week_code >
    < day_of_week_order > 2 < / day_of_week_order >
    Tuesday < day_of_week_name > < / day_of_week_name >
    < / days >
    < / mgns1:modifyPlannedItemStatus > ';

    I INTEGER: = 1;

    my_varchar VARCHAR2 (3000);
    BEGIN

    insert into session_temp_xml values (i, xmltype.createxml (my_clob));

    SELECT to_clob(extract(s.xml_data,'/modifyPlannedItemStatus/days[1]/day_of_week_order')) IN the s session_temp_xml my_varchar;


    dbms_output.put_line (' result ' |) RTrim (my_varchar));


    END;

    Hello

    'Re missing you the declaration of the namespace of the root node.

    extract( s.xml_data
           , '/mgns1:modifyPlannedItemStatus/days[1]/day_of_week_order'
           , 'xmlns:mgns1="http://www.mart-sw.co.uk/library"' )
    

    This will give you an instance of XMLType:

    1
    

    To convert it to CLOB or VARCHAR2 (i.e. to serialize the XML content in a character stream) use one of the getter methods getClobVal or getStringVal.
    If you want to retrieve the scalar value of the element (text node), use extractValue in place of the extract function.

    Here is an example on how to extract some repetitive elements in your version:

    SQL> create table session_temp_xml (
      2   id number,
      3   xml_data xmltype
      4  );
    
    Table created
    
    SQL> insert into session_temp_xml values (1, xmltype(
      2  '
      3  
      4  
      5   A
      6   1
      7   Monday
      8  
      9  
     10   B
     11   2
     12   Tuesday
     13  
     14  ')
     15  );
    
    1 row inserted
    
    SQL>
    SQL> SELECT extractValue(x.column_value, '/days/day_of_week_code') as day_of_week_code
      2       , extractValue(x.column_value, '/days/day_of_week_order') as day_of_week_order
      3       , extractValue(x.column_value, '/days/day_of_week_name') as day_of_week_name
      4  FROM session_temp_xml s
      5     , TABLE(
      6         XMLSequence(
      7           extract(
      8             s.xml_data
      9           , '/mgns1:modifyPlannedItemStatus/days'
     10           , 'xmlns:mgns1="http://www.mart-sw.co.uk/library"'
     11           )
     12         )
     13       ) x
     14  ;
    
    DAY_OF_WEEK_CODE      DAY_OF_WEEK_ORDER      DAY_OF_WEEK_NAME
    --------------------- ---------------------- ---------------------
    A                                          1 Monday
    B                                          2 Tuesday
     
    

    Hope that helps.

  • Remove unnecessary tags in XML using PL/SQL

    Hi friends

    the Sub XML, its build a SQL query complex, we need to remove all the tags of type objectand all the empty tags.

    Version PL/SQL Release 11.2.0.3.0 - Production

    < MajorLine >

    < MAJOR_LINE_OBJECT_TYPE > - need to remove these types of items showing in the XML file

    < LINEID > 143424538 < / LINEID >

    TC-ABC-123 < ITEMNAME > < / ITEMNAME >

    < > 78245 ITEMPATH < / ITEMPATH >

    < QUANTITY > 10 < / QUANTITY >

    < SERVICE / >-need to remove all empty tags

    < MINORLINE >

    < MINOR_LINE_OBJECT_TYPE > -need to remove these types of items showing in the XML file

    < LINEID > 143424799 < / LINEID >

    TCC - abc < ITEMNAME > < / ITEMNAME >

    < > 78245 ITEMPATH < / ITEMPATH >

    < QUANTITY > 10 < / QUANTITY >

    <SERVICE/ >-need to remove all empty tags

    < MINOR_MINOR_LINES >

    < M_MINOR_LINE_TYPE > -Need to remove these types of items showing in the XML file

    < LINEID > 143424798 < / LINEID >

    SF15-abc-xyz < ITEMNAME > < / ITEMNAME >

    < > 78245 ITEMPATH < / ITEMPATH >

    < QUANTITY > 10 < / QUANTITY >

    < / M_MINOR_LINE_TYPE > -Need to remove these types of items showing in the XML file

    < / MINOR_MINOR_LINES >

    < / MINOR_LINE_OBJECT_TYPE >-need to remove these types of items showing in the XML file

    < / MINORLINE >

    < / MAJOR_LINE_OBJECT_TYPE >-need to remove these types of items showing in the XML file

    < / MajorLine >

    I tried one of the queries posted in this blog, PFB to remove empty tags, but it did not work for me unfortunately. Help, please.

    PFB

    WITH sample_data LIKE)

    SELECT xmltype ("< MajorLine >

    < MAJOR_LINE_OBJECT_TYPE >

    < LINEID > 143424538 < / LINEID >

    hijk < ITEMNAME > < / ITEMNAME >

    < > 78245 ITEMPATH < / ITEMPATH >

    < QUANTITY > 10 < / QUANTITY >

    < SERVICE / >

    < MINORLINE >

    < MINOR_LINE_OBJECT_TYPE >

    < LINEID > 143424799 < / LINEID >

    EFG < ITEMNAME > < / ITEMNAME >

    < > 78245 ITEMPATH < / ITEMPATH >

    < QUANTITY > 10 < / QUANTITY >

    < SERVICE / >

    < MINOR_MINOR_LINES >

    < M_MINOR_LINE_TYPE >

    < LINEID > 143424798 < / LINEID >

    ABC < ITEMNAME > < / ITEMNAME >

    < > 78245 ITEMPATH < / ITEMPATH >

    < QUANTITY > 10 < / QUANTITY >

    < / M_MINOR_LINE_TYPE >

    < / MINOR_MINOR_LINES >

    < / MINOR_LINE_OBJECT_TYPE >

    < / MINORLINE >

    < / MAJOR_LINE_OBJECT_TYPE >

    (< / MajorLine > ') xmldoc

    OF the double

    )

    SELECT deleteXML (t.xmldoc

    ', ' / MajorLine / * [. = "" or contains(.,"?") "].

    ) as a result

    OF sample_data t

    ;

    My email is [email protected] - you can reach me

    Thanks in advance... Arun thomas T

    Hi again,

    A few general suggestions first:

    -do not give your e-mail address here, unless you want to be spammed for the next few weeks.

    -Mark all your previous sons answered if you feel your questions have been answered, it'll help people focus on new questions.

    On your new question:

    How the XML is generated?

    When someone asks questions on how to remove nodes from an XML, I always say the best way is to not generate them in the first place.

    That's why the SQL/XML functions are most often the best way to generate specific structures using other facilities 'out-of-the-box' such as DBMS_XMLGEN.

    DELETEXML is obsolete, and anyway this method is useful for deleting nodes.

    XSLT or XQuery is suitable for structural change in this case, although I would look first to get the necessary structure in the first place.

  • Add the element as XML using PL/SQL

    I have CLOB column contain data XML (more than 3000 characters)
    something like that
    --------------------------------------------------------------
    < order >
    < header >
    < line1 > < / line1 >
    < line2 >
    < name1 > < / name2 >
    < name1 > < / name2 >
    < / line2 >
    < / header >
    < detail >
    < / details >
    < / order >
    ----------------------------------------------------------------
    Could someone tell me how I can add a * < line3 > < / line3 > * under an element * < header > *.

    Thank you!
    FAH

    Here's one way:

    SQL> create table my_table ( my_clob clob );
    
    Table created
    
    SQL>
    SQL> insert into my_table (my_clob)
      2  values ('
      3  
    4 5 6 7 8 9
    10 11 12
    ') 13 ; 1 row inserted SQL> select appendchildxml( 2 xmltype(my_clob) 3 , '/order/header' 4 , xmlelement("line3") 5 ).getclobval() 6 from my_table 7 ; APPENDCHILDXML(XMLTYPE(MY_CLOB --------------------------------------------------------------------------------

    If you really want to update the column with the new content then:

    update my_table
    set my_clob = appendchildxml(
                    xmltype(my_clob)
                  , '/order/header'
                  , xmlelement("line3")
                  ).getclobval()
    where ...
    
  • How to analyze an XML using C++ or Cascades

    Hello

    I'm developing a simple application of the Listview, this need for an updated list with the response from the server in XML, the XML as below:

    
    
       
          Gambardella, Matthew
          XML Developer's Guide
          Computer
          44.95
          2000-10-01
          An in-depth look at creating applications
          with XML.
       
       
          Ralls, Kim
          Midnight Rain
          Fantasy
          5.95
          2000-12-16
          A former architect battles corporate zombies,
          an evil sorceress, and her own childhood to become queen
          of the world.
       
       
          Corets, Eva
          Maeve Ascendant
          Fantasy
          5.95
          2000-11-17
          After the collapse of a nanotechnology
          society in England, the young survivors lay the
          foundation for a new society.
       
       
          Corets, Eva
          Oberon's Legacy
          Fantasy
          5.95
          2001-03-10
          In post-apocalypse England, the mysterious
          agent known only as Oberon helps to create a new life
          for the inhabitants of London. Sequel to Maeve
          Ascendant.
       
       
          Corets, Eva
          The Sundered Grail
          Fantasy
          5.95
          2001-09-10
          The two daughters of Maeve, half-sisters,
          battle one another for control of England. Sequel to
          Oberon's Legacy.
       
       
          Randall, Cynthia
          Lover Birds
          Romance
          4.95
          2000-09-02
          When Carla meets Paul at an ornithology
          conference, tempers fly as feathers get ruffled.
       
       
          Thurman, Paula
          Splish Splash
          Romance
          4.95
          2000-11-02
          A deep sea diver finds true love twenty
          thousand leagues beneath the sea.
       
       
          Knorr, Stefan
          Creepy Crawlies
          Horror
          4.95
          2000-12-06
          An anthology of horror stories about roaches,
          centipedes, scorpions  and other insects.
       
       
          Kress, Peter
          Paradox Lost
          Science Fiction
          6.95
          2000-11-02
          After an inadvertant trip through a Heisenberg
          Uncertainty Device, James Salway discovers the problems
          of being quantum.
       
       
          O'Brien, Tim
          Microsoft .NET: The Programming Bible
          Computer
          36.95
          2000-12-09
          Microsoft's .NET initiative is explored in
          detail in this deep programmer's reference.
       
       
          O'Brien, Tim
          MSXML3: A Comprehensive Guide
          Computer
          36.95
          2000-12-01
          The Microsoft MSXML3 parser is covered in
          detail, with attention to XML DOM interfaces, XSLT processing,
          SAX and more.
       
       
          Galos, Mike
          Visual Studio 7: A Comprehensive Guide
          Computer
          49.95
          2001-04-16
          Microsoft Visual Studio 7 is explored in depth,
          looking at how Visual Basic, Visual C++, C#, and ASP+ are
          integrated into a comprehensive development
          environment.
       
    
    

    Please how can I parse the XML file.

    Thank you

    QXmlStreamReader for parsing XML files

    http://doc.Qt.Nokia.com/4.7-snapshot/qxmlstreamreader.html

    ... and for writing QXmlStreamWriter

    http://doc.Qt.Nokia.com/4.7-snapshot/qxmlstreamwriter.html

    The Reader bookmarks will be a great example for you:

    http://doc.Qt.Nokia.com/4.7-snapshot/XML-streambookmarks.html

  • How to access Mobile Oracle using PL/SQL Server logs?

    I started using Oracle solutions, so I'm a complete newbie.

    I am doing a project which requires to newspapers to mobile devices using the Oracle Mobile Server (integrated into Oracle Database Lite).
    The mobile server has services that I could use or do I interpret log files?

    Thanks in advance for all support!

    Published by: Hugo Zenha on April 15, 2009 07:40

    Details of base for sync history is MOBILEASDMIN. C$ SYNC_HISTORY. This will give you the id of the customer (name), start and end times, success or failure (and error if failure) as well as the total volume of data uploaded and downloaded.

    You can get more details by joining with c$ sync_his_pub_items on session_id, and this gives details of each downloaded table (phase = UPLOAD) regarding the timings and records and the same for the download. Upload tends to be the complete set of tables (records = 0 for no activity), while the download is only active tables and includes a full refresh occurred

    You can get information for the MGP process via mgp_history c$ and c$ mgp_his_clients

    As all the repository data is stored in the database, there are a lot of possibly interesting things if you look through it.

    We use SQL and PL/SQL to make reports on different users with clocks in a loading time and identification of customers having problems

  • How to set default cell format 'text' instead of 'general' sheet in excel using pl/sql code?

    Can someone please help me on how to generate excel file using pl/sql? I have generated csv files successfully, but now I need to generate a excel. I changed the code generation of the csv file, but the file gives me error when opening:

    "The file you are trying to open,"XXXX.xls", is in a different format than specified by the file extension. Do you want to open it now? »

    If I choose Yes then open the excel file, but it excludes the leading 0 in the front for one my column. How do I configure excel type default column as text rather than General, when you create the files? I also tried to generate excel file using xml. But I do not know how to set the type of column there, too. I'm using Oracle 11.2.0.3.0 and APEX 4.2.6.00.03. I'll call all these codes apex.

    Code1 is used:

    Declare

    output_header varchar2 (4000);

    fichier_en_sortie VARCHAR2 (255);

    Varchar2 (2) EOL: = Chr (13) | Chr (10);

    BEGIN

    output_header: = 'tls_tracking_id ' | Chr (9) | ' fnn_ext' | Chr (9) | "path_id' | EOL;

    fichier_en_sortie: = 'report_excel' |'. XLS;

    owa_util.mime_header ("application/octet ', false");

    HTP.p ('Content-Disposition: attachment; filename = "" | ") fichier_en_sortie |' « ') ;

    owa_util.http_header_close;

    HTP. PRN (output_header);

    for r in)

    Select tls_tracking_id, fnn_ext, DWD_DTOV_OUT_VW path_id

    where nbn_loc_id = 'LOC000138413115. '

    The order of tls_tracking_id LOOP)

    HTP. PRN (r.tls_tracking_id

    || Chr (9) | r.fnn_ext

    || Chr (9) | r.path_id

    || EOL

    );

    END LOOP;

    END;

    Code2 used :

    create or replace PACKAGE BODY IS pkg_excel_export

    PROCEDURE excel_open (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = ' <? XML version = "1.0" encoding = "ISO-8859-9"? > ' | Chr (10) |

    "< workbook xmlns =" "urn: schemas-microsoft - com:office:spreadsheet" ' | "

    Chr (10) |

    ""xmlns:o ="urn: schemas-microsoft-com ' ' |

    Chr (10) |

    "xmlns: x =" "urn: schemas-microsoft-com: excel" ' | "

    Chr (10) |

    ""xmlns:ss ="urn: schemas-microsoft - com:office:spreadsheet" ' |

    Chr (10) |

                            'xmlns:html=" http://www.w3.org/TR/REC-html40 ">' ||

    Chr (10) |

    ' < ExcelWorkbook xmlns = "urn: schemas-microsoft-com: excel" > ' |

    Chr (10) | ' < WindowHeight > 8580 < / WindowHeight > ' |

    Chr (10) | ' < WindowWidth > 15180 < / WindowWidth > ' | Chr (10) |

    ' < WindowTopX > 120 < / WindowTopX > ' | Chr (10) |

    ' < WindowTopY > 45 < / WindowTopY > ' | Chr (10) |

    ' < ProtectStructure > false < / ProtectStructure > ' | Chr (10) |

    ' < ProtectWindows > false < / ProtectWindows > ' | Chr (10) |

    ' < / ExcelWorkbook > ' | Chr (10) | "< Styles > | Chr (10) |

    '< ss:ID of style = 'Default' ss:Name 'Normal' = >' | Chr (10) |

    "< ss:Vertical alignment = 'Bottom' / >" | " Chr (10) |

    ' < borders / > '. Chr (10) | ' < police / > '. Chr (10) |

    ' < Interior / > '. Chr (10) | ' < NumberFormat / > '. Chr (10) |

    ' < protection / > '. Chr (10) | "< / style > | Chr (10) |

    '< ss:ID of style 's22' = >' | Chr (10) |

    "< x: font family = ss"Swiss":"BOLD"="1"ss:Underline ="Single"/ >" | "

    Chr (10) | "< / style > | Chr (10) | "< / style >";

    END excel_open;

    PROCEDURE excel_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < / workbook > ';

    END excel_close;

    / * Opens a worksheet in the Excel file. , You can open multiple worksheets. **/

    PROCEDURE worksheet_open

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_worksheetname in VARCHAR2

    ) IS

    BEGIN

    --

    -Create the worksheet

    --

    l_xml_body: = l_xml_body | "' < worksheet ss:Name = ' ' | p_worksheetname |

    "" > < table > ";"

    END worksheet_open;

    / *Farm the worksheet in the Excel file.   **/

    PROCEDURE worksheet_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < / table > < / worksheet > ';

    END worksheet_close;

    / *Opens the tag line * /

    PROCEDURE row_open (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | "< row >."

    END row_open;

    / *Farm the tag line * /.

    PROCEDURE row_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | "< / row > | Chr (10);

    END row_close;

    / *After the opening of the line, we can write something the first cell* /

    PROCEDURE cell_write

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_content in VARCHAR2

    ) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < cell > < data ss:Type = "String" > ' |

    p_content | ' < / data > < / cell > ';

    END cell_write;

    / * If you use this package of APEX, you get to download the excel file. **/

    PROCEDURE excel_get

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_filename in VARCHAR2

    ) IS

    XX BLOB;

    make the NUMBER;

    This NUMBER;

    BC NUMBER.

    LC NUMBER;

    w NUMBER;

    BEGIN

    DBMS_LOB.CREATETEMPORARY (xx, TRUE);

    make: = 1;

    so: = 1;

    BC: = dbms_lob.default_csid;

    LC: = dbms_lob.default_lang_ctx;

    w: = dbms_lob.no_warning;

    DBMS_LOB.converttoblob (xx,

    l_xml_body,

    DBMS_LOB.lobmaxsize,

    do,

    Thus,.

    British Colombia,

    LC,

    (w);

    owa_util.mime_header ("application/octet ', FALSE");

    -set the size so that the browser knows how to download

    HTP.p ("Content-length: ' |") DBMS_LOB.GetLength (xx));

    -the name of the file will be used by the browser if users only one save as

    HTP.p ('Content-Disposition: attachment; filename = "" | ") p_filename |

    '.xls ' | '"');

    -close the headers

    owa_util.http_header_close;

    -Download the BLOB

    wpg_docload.download_file (XX);

    END excel_get;

    END pkg_excel_export;

    I know it's a bit long code, but to better understand please consider...

    Thank you.

    I did worked putting just one extra line in my l_xml_body in the XML (Code 2 used). Now my excel generates with cells type 'Text' and there are no left falling to zero. Also the columns display not scientific format as 2.3D + 12. Current recording shows without default formatting.

    '

  • How can I recursively parse an xml using XQuery document?

    I have an open and I have to using XQuery in Response.xml can transform someone give me an idea how to analyze recursive Xml using XQuery documents. Any help will be appreciated. Thanks in advance

    Open

    " < = xmlns:ns0 ns0:GlobalRoutePlanServiceGOPResponse ' http://www.example.org/input ">

    < GlobalRoutePlanServiceResponse >

    < response >

    Buid_1 < Buid > < / Buid >

    SalesOrderId_1 < SalesOrderId > < / SalesOrderId >

    EODD_1 < EODD > < / EODD >

    LODD_1 < LODD > < / LODD >

    < legs >

    < leg >

    < level > 1 < / level >

    < Resources > ShipMode_1 < / resources >

    < FSBD > FSBD_1 < / FSBD >

    FABD_1 < FABD > < / FABD >

    < leg >

    < leg >

    < niv.2 > < / level >

    < Resources > ShipMode_2 < / resources >

    < FSBD > FSBD_1 < / FSBD >

    FABD_1 < FABD > < / FABD >

    < leg >

    < leg >

    < level > 3.1 < / level >

    < resources > ShipMode_3.1 & amp; < / resources >

    < FSBD > FSBD_1 < / FSBD >

    FABD_1 < FABD > < / FABD >

    < leg >

    < leg >

    < level > 4.1 < / level >

    < Resources > ShipMode_4.1 < / resources >

    < FSBD > FSBD_1 < / FSBD >

    FABD_1 < FABD > < / FABD >

    < leg > < / foot >

    < / foot >

    < / foot >

    < / foot >

    < leg >

    < level > 3.2 < / level >

    < Resources > ShipMode_3.2 < / resources >

    < FSBD > FSBD_1 < / FSBD >

    FABD_1 < FABD > < / FABD >

    < leg >

    < leg >

    < level > 4.2 < / level >

    < Resources > ShipMode_4.2 < / resources >

    < FSBD > FSBD_1 < / FSBD >

    FABD_1 < FABD > < / FABD >

    < leg > < / foot >

    < / foot >

    < / foot >

    < / foot >

    < / foot >

    < / foot >

    < / foot >

    < / foot >

    < / legs >

    < / answer >

    < / GlobalRoutePlanServiceResponse >

    < / ns0:GlobalRoutePlanServiceGOPResponse >

    Response.Xml

    " < = xmlns:ns0 ns0:InputParameters ' http://xmlns.Oracle.com/pcbpel/adapter/DB/SP/GOP_DB_FSL_Msg_Persist_SVC "> "

    < ns0:P_LEG >

    < ns0:P_LEG_ITEM >

    < ns0:LEGS_LEVEL > 1 < / ns0:LEGS_LEVEL >

    < ns0:SHIPMODE > ShipMode_1 < / ns0:SHIPMODE >

    < / ns0:P_LEG_ITEM >

    < ns0:P_LEG_ITEM >

    < ns0:LEGS_LEVEL > 2 < / ns0:LEGS_LEVEL >

    < ns0:SHIPMODE > ShipMode_2 < / ns0:SHIPMODE >

    < / ns0:P_LEG_ITEM >

    < ns0:P_LEG_ITEM >

    < ns0:LEGS_LEVEL > 3.1 < / ns0:LEGS_LEVEL >

    < ns0:SHIPMODE > ShipMode_3.1 < / ns0:SHIPMODE >

    < / ns0:P_LEG_ITEM >

    < ns0:P_LEG_ITEM >

    < ns0:LEGS_LEVEL > 4.1 < / ns0:LEGS_LEVEL >

    < ns0:SHIPMODE > ShipMode_4.1 < / ns0:SHIPMODE >

    < / ns0:P_LEG_ITEM >

    < ns0:P_LEG_ITEM >

    < ns0:LEGS_LEVEL > 3.2 < / ns0:LEGS_LEVEL >

    < ns0:SHIPMODE > ShipMode_3.2 < / ns0:SHIPMODE >

    < / ns0:P_LEG_ITEM >

    < ns0:P_LEG_ITEM >

    < ns0:LEGS_LEVEL > 4.2 < / ns0:LEGS_LEVEL >

    < ns0:SHIPMODE > ShipMode_4.2 < / ns0:SHIPMODE >

    < / ns0:P_LEG_ITEM >

    < / ns0:P_LEG >

    < / ns0:InputParameters >

    You can use recursive expressions function XQuery to browse down the tree (even if it's more than a job for XSLT), but in this case, it is probably easier to use a descendant axis:

    declare namespace ns0 = "http://xmlns.oracle.com/pcbpel/adapter/db/sp/GOP_DB_FSL_Msg_Persist_SVC";

    declare namespace ns1 = "http://www.example.org/INPUT";

    {

    for $i in $request / ns1:GlobalRoutePlanServiceGOPResponse / GlobalRoutePlanServiceResponse/response/legs / / leg

    where exists($i/Level)

    return

    {$i} / level/text)

    {$i} / ShipMode/text)

    }

    Output:

    http://xmlns.Oracle.com/pcbpel/adapter/DB/SP/GOP_DB_FSL_Msg_Persist_SVC">

    1

    ShipMode_1

    2

    ShipMode_2

    3.1

    ShipMode_3.1 &

    4.1

    ShipMode_4.1

    3.2

    ShipMode_3.2

    4.2

    ShipMode_4.2

  • inserting rows using pl sql

    Hi all

    I created a tabale to insert a number

    create the table loc_number (c1 number);

    now, I want to insert 10 lines in this table using pl sql.

    How can I do so using pl sql?

    Hello

    Yes it is possible.

    Why use loops here?

    (I guess, you need to practice this goal)

    begin
    
     for i in 1..10
     loop
    
       insert into loc_number
           values (i);
    
     end loop;
    
     commit;
    
    end;
    
  • How to generate XML nested using PL/SQL data?

    I have an XML that looks like this file...

    <? XML version = "1.0"? >
    < TDefs >
    < ListItem >
    < TDef >
    < DisplayName > AFP < / DisplayName >
    < enabled > True < / enabled >
    < LISName > AFP < / LISName >
    < LOINC / >
    < PrintName > AFP < / PrintName >
    < CompatibilityCode > 1 < / CompatibilityCode >
    < details >
    < PatientReplicates > 1 < / PatientReplicates >
    < AutoReDilute > false < / AutoReDilute >
    < / details >
    < DilutionList >
    < TDefDilution >
    < dilution > 1 < / Dilution >
    < CalculationFactor > 1 < / CalculationFactor >
    < / TDefDilution >
    < / DilutionList >
    < TDefRange >
    < RangeList >
    < RangeInfo >
    < ID >
    < int > 6509 < / int >
    < /ID >
    < name >
    < string > check Range2 < / string >
    < / name >
    < Name_MessageID >
    < int >-1 < / int >
    < / Name_MessageID >
    < IsNull RepeatedlyReactiveData = "true" / >
    < IsNull RepeatedlyReactiveComments = "true" / >
    < CreatedByIM >
    < Boolean > true < / Boolean >
    < / CreatedByIM >
    < / RangeInfo >

    This is data that are from different tables. It is a multilevel nested nodes each other.
    How do I achieve using PL/SQL? What is the best way?

    I've only used to date dbms_xmlgen to generate data from a single table.
    Can anyone help?

    How do I achieve using PL/SQL? What is the best way?

    SQL/XML functions.

    For example: {message identifier: = 9670705}

    After a few data structures and table (DDL) samples if you need specific help on the query.

  • Nested reading XML using XQUERY in the PL/SQL procedure

    I'm using Oracle 11 G.
    I have a PL/SQL procedure, which is reading XML using xquery XMLTYPE column in a table. The XML contains data of the DEPARTMENT and its SECTIONS. DEPARTMENT has a to-many with SECTIONS or a DEPARTMENT can have one or more SECTIONS, and there may be cases where the DEPARTMENT will have all SECTIONS.

    The XML structure is such that
    <DATA>
    label to identify a DEPARTMENT and all its corresponding SECTIONS.

    XML
    <ROWSET> 
    <DATA>
     <DEPARTMENT>
      <DEPARTMENT_ID>DEP1</DEPARTMENT_ID>
      <DEPARTMENT_NAME>myDEPARTMENT1</DEPARTMENT_NAME>
     </DEPARTMENT>
     <SECTIONS>
      <SECTIONS_ID>6390135666643567</SECTIONS_ID>
      <SECTIONS_NAME>mySection1</SECTIONS_NAME>
      </SECTIONS>
       <SECTIONS>
      <SECTIONS_ID>6390135666643567</SECTIONS_ID>
      <SECTIONS_NAME>mySection2</SECTIONS_NAME>
      </SECTIONS>
     </DATA>
     <DATA>
     <DEPARTMENT>
      <DEPARTMENT_ID>DEP2</DEPARTMENT_ID>
      <DEPARTMENT_NAME>myDEPARTMENT2</DEPARTMENT_NAME>
     </DEPARTMENT>
     <SECTIONS>
      <SECTIONS_ID>63902</SECTIONS_ID>
      <SECTIONS_NAME>mySection1</SECTIONS_NAME>
      </SECTIONS>
     </DATA>
    </ROWSET>
    XQUERY
    select
     department_id,
      department_name,
      sections_id,
      sections_name
    from
      OFFLINE_XML xml_list,
      xmltable(
        '
          for $department in $param/ROWSET/DATA
            return $department
        '
        passing xml_list.xml_file as "param"
        columns
          "DEPARTMENT_ID"   varchar2(100) path '//DEPARTMENT/DEPARTMENT_ID',
          "DEPARTMENT_NAME" varchar2(4000) path '//DEPARTMENT/DEPARTMENT_NAME',
          "SECTIONS_ID"     varchar2(100) path '//SECTIONS/SECTIONS_ID',
          "SECTIONS_NAME"   varchar2(4000) path '//SECTIONS/SECTIONS_NAME'
      ) section_list
    where
      xml_list.Status = 5
    The performance of the query, you receive an error
    ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton 
    sequence - got multi-item sequence
    It is natural because I have several sections, now how I'll handle this situation.

    It's the usual approach to manage several nested collections:

    SQL> select d.department_id
      2       , d.department_name
      3       , s.sections_id
      4       , s.sections_name
      5  from offline_xml t
      6     , xmltable(
      7         '/ROWSET/DATA'
      8         passing t.xml_file
      9         columns
     10           DEPARTMENT_ID   varchar2(20) path 'DEPARTMENT/DEPARTMENT_ID'
     11         , DEPARTMENT_NAME varchar2(30) path 'DEPARTMENT/DEPARTMENT_NAME'
     12         , SECTIONS        xmltype      path 'SECTIONS'
     13       ) d
     14     , xmltable(
     15         '/SECTIONS'
     16         passing d.sections
     17         columns
     18           SECTIONS_ID     varchar2(20) path 'SECTIONS_ID'
     19         , SECTIONS_NAME   varchar2(30) path 'SECTIONS_NAME'
     20      ) s
     21  ;
    
    DEPARTMENT_ID        DEPARTMENT_NAME                SECTIONS_ID          SECTIONS_NAME
    -------------------- ------------------------------ -------------------- ------------------------------
    DEP1                 myDEPARTMENT1                  6390135666643567     mySection1
    DEP1                 myDEPARTMENT1                  6390135666643567     mySection2
    DEP2                 myDEPARTMENT2                  63902                mySection1
     
    
  • How to use PL/SQL to create dynamic action to set the value of a selection by another list?

    Hello

    I would like to know how to use PL/SQL to create dynamic action to set the value of a list of selection by another selection list.

    1.PNG

    I wish can create dynamic action to manage the two above the Room select list (: P9_ROOM) and building (: P8_BUILDING).

    When you select "1074" in the bathroom, building highlights like "BRM BLD 5"

    When you select 'Area of the black box' in the room, building must assign the value "7 BLD BRM"

    When the room is Null, building should also be Null.

    I thank you,

    Alice

    I forgot to mention, for the PL/SQL Code, because you are working with items in the selection list, the return values are different from the display on your LOV values, you must instead use the return values.

    Thank you

    Erick

  • How to modify data in "Result grid query" in Oracle SQL developer

    Dear,

    I would like to know how to change values directly in the query result grid.

    I use Oracle SQL Developer version 4.0.3.16

    Thank you

    Khalil

    EditValues.JPG

    I checked in SQL Developer 4 and I found no option to do this.

    I don't think it's available. You can open the table and add filters on each column and change. Or you can add where clause as suggested the link written by Jeff that I already gave. (http://www.thatjeffsmith.com/archive/2013/06/sql-developer-im-looking-at-a-record-how-do-i-edit-it/)

    Or you write update instructions.

    See you soon

    AJ

  • How to get several xml elements in a relationship 1: n without using xmlaggregation

    I need to create the following xml structure from an oracle database

    where each survey can multiple deelnemers (participants)

    I'm not sure create this use of XMLElement without getting the message "ORA-01427 subquery returns more then one line."

    I could try to use dbms_xmldom (never done that before) but I wonder if anyone knows how to generate this just using the plain Oracle SQL-XMLfunctions (XMLElement, XMLAggr)

    < NieuweSurveys >

    < survey >

    < Surveynaam > 2013 - 02 - 01 < / Surveynaam >

    < Months > 2013 - 02 - 01 < / months >

    < Einddatum > 2013 - 02 - 15 < / Einddatum >

    < Deelnemer >

    Tilde < Chairwoman > < / Chairwoman >

    < Tussenvoegsel / >

    DeelnemerA < Achternaam > < / Achternaam >

    man < Geslacht > < / Geslacht >

    < Emailadres > [email protected] < / Emailadres >

    < Voorkeurstaal > nl < / Voorkeurstaal >

    Schouten < account > & Nelisen < / account >

    bouwer < function > < / function >

    < / Deelnemer >

    < Deelnemer >

    Tilde < Chairwoman > < / Chairwoman >

    < Tussenvoegsel / >

    DeelnemerB < Achternaam > < / Achternaam >

    Vrouw < Geslacht > < / Geslacht >

    < Emailadres > [email protected] < / Emailadres >

    < Voorkeurstaal > nl < / Voorkeurstaal >

    Schouten < account > & Nelisen < / account >

    Tester of < function > < / function >

    < / Deelnemer >

    < / inquiry >

    < / NieuweSurveys >

    What is your version of the database? (SELECT * FROM version$ v)

    The query does not match the output that you claim that it produces.

    In any case, the problem is the following:

    ) as "deelnemers.

    Put an alias here should not generate an element - unless you are using XMLForest in your actual query without your telling us.

    That's why I ask about the version of db, it could be an old bug that's been fixed now (I have not to reproduce the behavior on 11.2).

    What happens when you delete the alias?

Maybe you are looking for