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.

Tags: Oracle Development

Similar Questions

  • LOBs and how to retrieve the record inserted with EMPTY_BLOb()

    Hi guys


    How to retrieve the records inserted with EMPTY_BLOb() instead of NULL value.


    Best greetings
    A.G.

    There must be a better way, but these work:

    SELECT... from tableX where length (lob_column) = 0;
    SELECT... from tableX where dbms_lob.getlength (lob_column) = 0;

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    "All experts it is a equal and opposite expert."
    Clarke

  • How to view multiple records to a report form - as the model?

    Hi all
    I developed a form - like model report
    I want to show him several records at once (on the same page)
    I tried assigning a value of "Maximum records per page" property for the extensible framework 10
    but when I close the range property and open it again the value returns to 1!
    How to display multiple records on the same page?

    Thank you

    Hello

    check around your formatting images if all have the "vertical stretch" value to the variable or develop.

  • 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

  • How to concatenate multiple records in a single

    Hello world:

    I want to know if is a way to concat multiple records into one without the help of the sliders. For example, I have a table named "Authors" like this:

    LAN | Author
    -----------------
    English | Ernest Hemingway
    Spanish | Octavio Paz
    Spanish | Mario Vargas Llosa
    English | Sinclair Lewis
    Spanish | Gabriel García Márquez


    And I want to get this:

    Author
    -----------------
    Octavio Paz, Mario Vargas Llosa, Gabriel García Márquez

    I have worked with SQL Server and I can do something like this:

    CREATE FUNCTION dbo. MyConcat (@lan varchar (10))
    RETURNS varchar (5000) AS
    BEGIN
    declare @retvalue varchar (5000)
    Set @retvalue = "
    Select @retvalue = @retvalue + author + ',' authors where lan = @lan
    return substring (@retvalue, 1, len (@retvalue)-1)
    END

    That is to say, do not use cursors to concatenate records. However, with ORACLE, I do something like that.

    FUNCTION MyConcat(P_Lan IN VARCHAR2) VARCHAR2 IS BACK
    v_ret VARCHAR2 (4000);
    v_element VARCHAR2 (4000);
    v_cursor sys_refcursor;
    BEGIN
    OPEN to SELECT V_cursor author of authors where Lan = P_Lan
    LOOP
    SEEK v_cursor INTO v_elemento;
    OUTPUT WHEN v_cursor % NOTFOUND;
    IF v_ret IS NULL THEN
    v_ret: = v_element;
    ON THE OTHER
    v_ret: = v_ret | ', ' || v_element;
    END IF;
    END LOOP;
    RETURN v_ret;
    END;

    There is another way to to do?

    Best regards
    Jack

    You can find plenty of examples here:

    http://www.Oracle-base.com/articles/Misc/StringAggregationTechniques.php

    and also here:

    http://www.sqlsnippets.com/en/topic-11787.html

    Published by: hoek on October 21, 2010 17:50

  • 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 >

  • How to filter the doc and xml using SDKFileOpenChooser?

    I need to filter only word and xml

    SDKFileOpenChooser openChooser;

    openChooser.AddFilter (291, "App_Filter");   291 for app

    openChooser.ShowDialog ();


    Where to find the ID of the extension for the filter application or any solution?

    To display only the XML using SDKFileOpenChooser files use:

    openChooser.AddFilter (kXMLFileTypeInfoID, "files (xml)" "") XML;

    To Word files, try to use kMSWordFileTypeInfoID instead.

  • How to select only the part by using the sql query

    Hello

    I have the task to retrieve only the integral of the input text by using the sql query.

    The entry is as follows

    Entry for the price setting

    $12.5 (FYI without space)

    $ 12.5 (FYI single space)

    $ 12.5 (double space FYI)

    $12.5 (FYI multiple space)

    $12.5 (FYI multiple space)

    Output expected of 12.5

    The price is the type varchar2 column in the store_price table.

    Please let me know how to achieve this.

    Thanks in advance.

    If this is always the case that you get a $ followed by a number of places, you can use something like:

    Select to_number (ltrim ('$ 12.5',' $')) DOUBLE

    or

    SELECT ltrim ('$ 12.5',' $') OF double

    but take care of your nls_numeric_character settings if they are defined so that, for example, a comma is the decimal separator, you will have a problem.

    HTH

  • 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.

  • retrieve the value of xml in PL - SQL elements

    Hello

    I invoke the PL/SQL WSDL and WSDL is back after the release.

    + <? XML version = "1.0" encoding = "UTF-8"? > +.
    + < SOAP - ENV:Envelope +.
    xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/".
    xmlns:SOAP - ENC = "http://schemas.xmlsoap.org/soap/encoding/".
    container = "http://www.w3.org/2001/XMLSchema".
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" >
    + < SOAP - ENV:Header +.
    xmlns:SOAP - ENV = 'http://schemas.xmlsoap.org/soap/envelope/' > < / SOAP - ENV:Header > < SO
    AP - ENV:Body >
    + < ser-root: soapIntefraceASVOutput +.
    xmlns:SER - root = http://eai.corpit.microsoft.com/microAccountValidation/provider/Acc «»
    ountStringValidator' > < acctStringValidateOutput >
    + < 112 > status < / status > +.
    + < message > in +.
    account segment is valid
    code < / message > < / acctStringValidateOutput > < / ser-root: soapIntefraceASVOutput > < / SOA
    P ENV:Body >
    + < / SOAP - ENV:Envelope > +.

    I tried to analyze this XML in my PL/SQL block and wanted to retrieve a State <>and < message > element Value.

    Please help me on this.

    Thank you
    AB,

    ABA says:
    Since it is a generic procedure, and we do not know the number of output items... Is it possible to retrieve all the elements of output using pl/sql (without knowing the name of the output items).

     with tab
            as (select xmltype.createxml('
      
     
     
     
        
           
               112
               Invalid account segmentcode
          
        
     ')
                          xml
                 from dual)
     SELECT column_value
       FROM tab t ,
      xmltable( xmlnamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV",'http://eai.corpit.microsoft.com/microAccountValidation/provider/AccountStringValidator' AS "ser-root"), 'data(//SOAP-ENV:Envelope/SOAP-ENV:Body/ser-root:soapIntefraceASVOutput/acctStringValidateOutput/*)' passing t.xml )
    

    Ravi Kumar

  • How to remove the label of xml data in sql

    with a as
    (select '<?xml version="1.0"?>
    <ROWSET>
      <DEPT>
        <DEPTNO>10</DEPTNO>
        <DNAME>ACCOUNTING</DNAME>
        <LOC>NEW YORK</LOC>
        <EMP_LIST>
          <EMP_ROW>
            <EMPNO>7782</EMPNO>
            <ENAME>CLARK</ENAME>
            <JOB>MANAGER</JOB>
            <MGR>7839</MGR>
            <HIREDATE>09-JUN-1981 00:00:00</HIREDATE>
            <SAL>2450</SAL>
          </EMP_ROW>
        </EMP_LIST>
      </DEPT>
    </ROWSET>' from dual)
    select * from a;
    


    I want the output after removing the same < HIREDATE > tag

    <?xml version="1.0"?>
    <ROWSET>
      <DEPT>
        <DEPTNO>10</DEPTNO>
        <DNAME>ACCOUNTING</DNAME>
        <LOC>NEW YORK</LOC>
        <EMP_LIST>
          <EMP_ROW>
            <EMPNO>7782</EMPNO>
            <ENAME>CLARK</ENAME>
            <JOB>MANAGER</JOB>
            <MGR>7839</MGR>       
            <SAL>2450</SAL>
          </EMP_ROW>
        </EMP_LIST>
      </DEPT>
    </ROWSET>
    

    Please help me

    SQL> with a as (
      2  select '
      3  
      4    
      5      10
      6      ACCOUNTING
      7      NEW YORK
      8      
      9        
     10          7782
     11          CLARK
     12          MANAGER
     13          7839
     14          09-JUN-1981 00:00:00
     15          2450
     16        
     17      
     18    
     19  ' xmlcontent
     20  from dual
     21  )
     22  select xmlserialize(document
     23           xmlquery(
     24             'copy $d := .
     25              modify delete node $d/ROWSET/DEPT/EMP_LIST/EMP_ROW/HIREDATE
     26              return $d'
     27             passing xmlparse(document a.xmlcontent)
     28             returning content
     29           )
     30           indent
     31         ) as xmlcontent
     32  from a ;
    
    XMLCONTENT
    --------------------------------------------------------------------------------
    
    
      
        10
        ACCOUNTING
        NEW YORK
        
          
            7782
            CLARK
            MANAGER
            7839
            2450
          
        
      
    
    
  • How to retrieve unique records with multiple columns

    I have a sps_prod table as described below-

    POGNAME VARCHAR2 (1500)
    INDEX #VERSION VARCHAR2 (200)
    POG_MODEL_STATUS VARCHAR2 (100)
    POG_LAYOUT_TYPE VARCHAR2 (500)
    POG_MARKET_SPECIFIC VARCHAR2 (500)
    POG_CONTACT_NUMBER VARCHAR2 (100)
    AREA_SUPPORTED VARCHAR2 (500)
    POG_COMMENTS VARCHAR2 (1500)
    POG_FOOTER_COMMENTS VARCHAR2 (1500)
    POG_ELECTRICAL_LIST_1 VARCHAR2 (1500)
    POG_ELECTRICAL_LIST_2 VARCHAR2 (1500)
    POG_CARPENTRY_1 VARCHAR2 (1500)
    POG_CARPENTRY_2 VARCHAR2 (1500)
    INSTALLATION_INSTRUCTION_1 VARCHAR2 (1500)
    INSTALLATION_INSTRUCTION_2 VARCHAR2 (1500)
    FIXTURE_REORDER_NUMBER VARCHAR2 (200)
    FIXTURE_ID VARCHAR2 (200)
    FIXTURE_NAME VARCHAR2 (500)
    FIXTURE_IMAGE VARCHAR2 (500)
    PART_REORDER_NUMBER_9 VARCHAR2 (500)
    PART_FIXTURE_ID_9 VARCHAR2 (500)
    PART_FIXTURE_NAME_9 VARCHAR2 (500)
    PART_FIXTURE_IMAGE_9 VARCHAR2 (500)
    UPC VARCHAR2 (50)
    ITEM_NUMBER VARCHAR2 (50)
    DESCRIPTION VARCHAR2 (700)
    MERCH_TYPE VARCHAR2 (20)
    HEIGHT VARCHAR2 (100)
    WIDTH VARCHAR2 (100)
    DEPTH VARCHAR2 (100)
    DATE OF CREATE_TS

    There are 4 million records in it and many with the same combination of POGName, #Version, POG_Model_Status, POG_Layout_Type, POG_Market_Specific, POG_Contact_Number and Fixture_Name Index. How do the records to retrieve all the columns above, but with a unique combination of fixture_name and reorder_number. It has no keys defined on the table.

    I guess that it is a simple problem but the fact I'm trying to retrieve all the columns I'm stumbling.

    Thanks in advance.

    Hello

    Sanders_2503 wrote:
    ... There are 4 million records in it and many with the same combination of POGName, #Version, POG_Model_Status, POG_Layout_Type, POG_Market_Specific, POG_Contact_Number and Fixture_Name Index. How do the records to retrieve all the columns above, but with a unique combination of fixture_name and reorder_number.

    I don't see a column named reorder_number. Do you mean fixture_reorder_number or part_reorder_number_9?

    So, you want only one row for each distinct combination of fixture_name and some other column (I'll assume it's fixture_reorder_number). Does it matter which line? They will not necessarily have the same values for the other columns.
    The following query returns the one with the first pogname (in sort order):

    WITH     got_r_num     AS
    (
         SELECT  pogname, index#version, pog_model_status, pog_layout_type
         ,     pog_market_specific, pog_contact_number, fixture_name
         ,     ROW_NUMBER () OVER ( PARTITION BY  fixture_name
                                   ,                    fixture_reorder_number
                             ORDER BY        pogname
                           )         AS r_num
         FROM    sps_prod
    )
    SELECT  pogname, index#version, pog_model_status, pog_layout_type
    ,     pog_market_specific, pog_contact_number, fixture_name
    FROM     got_r_num
    WHERE     r_num     = 1
    ;
    

    If there be a tie (i.e. two or more lines with the same fixture_name, fixture_number and pogname first) and then the will be chosen arbitrarily.

    Instead of "ORDER BY pogname", you can ORDER all the other columns OR expressions, but you must have an ORDER byclause of analytics. You can do "ORDER BY NULL" If you really want pcik an arbitrary line.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and also publish the results you want from these data (or some examples of acceptable results).
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • How to retrieve multiple e-mail accounts of the BlackBerry smart phone by programming

    Hello

    We can add up to 10 email accounts in a blackberrylike hotmail, gmail etc. I'm developing an application in which I want the list of all configured e-mail accounts.

    How can I retrieve it programmatically?

    Thanks in advance

    Thanks a lot for your quick response

  • How to update multiple records

    Hello

    I have this problem

    I have this table whith 100,000 records with the State of the column = DONE

    NUM_CUSTSTATUSDATE
    00931754FACT05/05/2015-00:00:00
    00931741FACT05/05/2015-00:00:00
    00931742FACT05/05/2015-00:00:00
    00931744FACT05/05/2015-00:00:00
    00931743FACT05/05/2015-00:00:00
    00931747FACT05/05/2015-00:00:00
    00931746FACT05/05/2015-00:00:00

    I need to update the State of the column with values from another table

    AU_NUM_CUSTAU_DATEAU_STATUS
    0093175405/05/2015-00:00:00FACT
    0093174105/05/2015-00:00:00DELETE
    0093174205/05/2015-00:00:00DELETE
    0093174405/05/2015-00:00:00DELETE
    0093174305/05/2015-00:00:00DELETE
    0093174705/05/2015-00:00:00DELETE
    0093174605/05/2015-00:00:00DELETE

    Thanks if you can help

    Hello

    You can use the merge sql stmt:

    merge into target_table t

    using s source_table

    on (t.num_cust = s.au_num_cust and = t.date s.au_date)

    When matched then

    update set s.au_status = t.status

    Greetings,

    SIM

  • [ADF, JDev 12.1.3] How to display multiple records on the same page... not in a table but they appear a form for each record

    Hallo,

    I need to create a page that displays the records of a VO, but I would not use a table.

    Instead, I would like to display a form for each record to be displayed.

    Forms must appear one above the other and each form should have 2 buttons: one to remove the file/form itself and one to add a new file/form.

    When you press the button Add a new empty form should be dynamically added to the page (so that the user can fill) and created related record.

    When REMOVE button is pressed the form (which contains the operated button) should be disappear and the record shuould be deleted.

    Creations and destruction must be applied only if the user clicks a button on CONFIRMATION / COMMIT.

    Maybe this http://digilander.libero.it/flattit82/OTN_FILES/MultiFormPage.png picture can help to understand what I want to do.

    You kindly help me?

    Thank you

    Federico

    Hi Federico

    I was saying that your page layout can be achieved using af: table

    See this image:

    This provision is af:table (I think same as yours), just add a column in the table and put all the fields in this column then correct layout allows to design as a provision on the form or group layouts

    I'm not saying it's the best approach, but you can try this

    Thank you

Maybe you are looking for

  • 10.10.5 OSX update can not be installed

    I finally had time to update to 10.10.5 and I get the message "Update OS X cannot be installed to this disk. This volume does not meet the conditions required for this update"- what this means? I thought that meant it he don't are not enough space on

  • Satellite U400-15E: cannot use Bluetooth

    Hey guys Newbie here.I just bought a new satellite U400-15e.I did as follows. The switch market and fn + f8.Everything is on and without bluetooth installation came. All advice is appreciated. Off topic, I bought my laptop in March, but when I regist

  • Play, stop after 15 seconds on iPod Shuffle

    My wife I recently purchased an iPod Shuffle and headphones Skullcandy method for Christmas. The plan was to use for the race (Skullcandy are more comfortable than most of the Earbud Headphones, Apple included). Unfortunately, when I try to play musi

  • Problem restoring from Time Machine complex

    BACKGROUND: I never tried to do a restore from Time Machine. PROBLEM: 2009 iMac internal drive is unreadable. * Previously saved on Time Machine before the problem of disk internal. Replaced the internal drive with 500 GB ssd When I try to restore th

  • FTP Get file Help

    Hello I try to use FTP Get File to get a picture of my NI1772C smart camera, but I can't make it work. I think the problem is that I don't really understand what I should put in the local path and the remote path box. The image is saved in the root (