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.

Tags: Oracle Development

Similar Questions

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

  • 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 remove duplicates from a Table using PL/SQL

    I created the following tables with data:

    * Table 1: *.



    Department of CREATE TABLE

    (DEPARTMENT_ID 4 NUMBER PRIMARY KEY,

    DEPARTMENT_NAME VARCHAR2 (20).

    ADDRESS VARCHAR2 (20));







    INSERT INTO Department VALUES (10, 'ACCOUNTING', 'NEW YORK');

    INSERT INTO Department VALUES (20, "SEARCH", "DALLAS");

    INSERT INTO Department VALUES (30, 'SALES', 'CHICAGO');

    INSERT INTO Department VALUES (40, 'OPERATIONS', 'BOSTON');

    COMMIT;



    * 2nd table: *.

    CREATE TABLE employee

    (EMPLOYEE_ID NUMBER 4 PRIMARY KEY,

    EMPLOYEE_NAME VARCHAR2 (20).

    USE VARCHAR2 (20).

    MANAGER_ID NUMBER 4,

    HIRE_DATE DATE,

    NUMBER OF SALARY (9, 2)

    COMMISSION (9, 2) NUMBER,

    Department_id number 4 REFERENCES department (DEPARTMENT_ID));






    INSERT INTO employee

    VALUES (7839, 'KING', 'PRESIDENT', NULL, NOVEMBER 17, 81 ', 5000, NULL, 10);

    INSERT INTO employee

    VALUES (7698, "BLAKE", "MANAGER", 7839, MAY 1, 81 ', 2850, NULL, 30);

    INSERT INTO employee

    VALUES (7782, "CLARK", "MANAGER", 7839, JUNE 9, 81 ', 2450, NULL, 10);

    INSERT INTO employee

    VALUES (7566, "JONES", "MANAGER", 7839, APRIL 2, 81 ', 2975, NULL, 20);

    INSERT INTO employee

    VALUES (7654, 'MARTIN', 'SELLER', 7698, 28-SEP-81', 1250, 1400, 30);

    INSERT INTO employee

    VALUES (7499, 'ALLEN', 'SELLER', 7698, FEBRUARY 20, 81 ', 1600, 300, 30);

    INSERT INTO employee

    VALUES (7844, 'TURNER', 'SELLER', 7698, ' 08-SEP-81', 1500, NULL, 30);

    INSERT INTO employee

    VALUES (7900, 'JAMES', 'CLERKS', 7698, 3 DECEMBER 81', 950, NULL, 30);

    INSERT INTO employee

    VALUES (7521, 'WARD', 'SELLER', 7698, FEBRUARY 22, 81 ', 1 250, 500, 30);

    INSERT INTO employee

    VALUES (7902, "FORD", "ANALYST", 7566, DECEMBER 3, 81 ', 3000, NULL, 20);

    INSERT INTO employee

    VALUES (7369, 'SMITH', 'CLERKS', 7902, DECEMBER 17, 81 ', 800, NULL, 20);

    INSERT INTO employee

    VALUES (7788, 'SCOTT', 'ANALYST', 7566, DECEMBER 9, 82 ', 3000, NULL, 20);

    INSERT INTO employee

    VALUES (7876, ' ADAMS, "CLERK", 7788, 12 JANUARY, 83', 1100, NULL, 20);

    INSERT INTO employee

    VALUES (7934, 'MILLER', 'CLERKS', 7782, JANUARY 22, 82 ', 1300, NULL, 10);

    COMMIT;



    I need to print all Department names, employee and salary. I did this, but how can display the name of each Department only once?





    Here is my code:



    DECLARE

    v_department_name department.department_name%TYPE;

    v_employee_name employee.employee_name%TYPE;

    v_salary employee.salary%TYPE;

    CURSOR dept_cur

    IS

    SELECT employee_name, department_name, Department OF employee salary

    WHERE department.department_id = employee.department_id (+)

    ORDER BY department_name, employee_name;

    BEGIN

    OPEN dept_cur.

    EXTRACT the dept_cur IN v_department_name, v_employee_name, v_salary;

    DBMS_OUTPUT. PUT_LINE ('DEPARTMENT_NAME EMPLOYEE_NAME WAGES');

    DBMS_OUTPUT. PUT_LINE('---------------------------------------------------');

    While dept_cur % FOUND

    LOOP

    DBMS_OUTPUT. Put_line (RPAD (v_department_name, 10) |) ' ' || RPAD (v_employee_name, 10). ' ' || v_salary);

    EXTRACT the dept_cur IN v_department_name, v_employee_name, v_salary;

    END LOOP;

    CLOSE Dept_cur;

    END;

    I would appreciate if you could help me with this. I'm sure it's a quick and easy answer, but I can't do it. I spent so much time already.

    Published by: 831522 on January 26, 2011 11:44

    It is a problem of display/reports rather than a problem of duplication of query data. The answer depends on what tools you use to query and display the data. You can use the clause "break it" I suggested earlier if you use SQL Plus.

    Otherwise, you can try this based on the version of Oracle you are using. Someone else may be able to get the data in a single pass.

    SELECT decode(emp_id, 1, department_name) department_name, employee_name, salary
    FROM(SELECT department_name, employee_name, salary,
           ROW_NUMBER() OVER (PARTITION BY department_name order by department_name, employee_name) AS emp_id
         FROM department
         LEFT OUTER JOIN employee ON (department.department_id = employee.department_id)
    ORDER BY department_name, employee_name, emp_id);
    
  • To remove data XML from XML using REGEXP_REPLACE tags

    Hello

    I try to use the SQL REGEXP_REPLACE function on a piece of XML, to remove the actual XML data from the weather. My ultimate goal is to end up with a list separated by commas to names of XML elements. In the first stage, I want to just pull all of the actual data.

    I tested the following query, and it initially appeared to work:
    SELECT REGEXP_REPLACE('&gt;THIS IS A TEST&lt;', 
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;' ) AS test_result
      FROM dual;
    Unfortunately, when I applied it to a full XML string, it did not. Here is the query to test that I used:
    SELECT REGEXP_REPLACE('&lt;ROW&gt;&lt;TEST_ELEMENT1&gt;123&lt;/TEST_ELEMENT1&gt;&lt;TEST_ELEMENT2&gt;THIS IS A TEST!&lt;/TEST_ELEMENT2&gt;&lt;/ROW&gt;',
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;') AS test_result
      FROM dual;
    I found myself with the following result:

    * & lt; LINE & gt; & lt; / LINE & gt; *

    What I was trying to a:

    * & lt; LINE & gt; & lt; TEST_ELEMENT1 & gt; & lt; / TEST_ELEMENT1 & gt; & lt; TEST_ELEMENT2 & gt; & lt; / TEST_ELEMENT2 & gt; & lt; / LINE & gt; *

    If you are reading this and you are a Posix regular expression guru, could you let me know exactly where I am going wrong? Regular expressions are not my strong point, but I would better go home.

    Hello

    For your final requirement, the 'commas list names of XML elements', what using XQuery with something like:

    SELECT xmlquery(
      'string-join( for $i in $d//*
                    return local-name($i), "," )'
      passing xmltype('123THIS IS A TEST!') as "d"
      returning content
    ).getStringVal()
    FROM dual;
    
  • Need to remove the tags file Nullable while generating XML files

    Hello.

    I have a requirement where I have to generate an XML file, but the generated XML file does not display the tags when the column is null. An example below:

    CREATE TABLE emp_tab (emp_id NUMBER PRIMARY KEY
    name VARCHAR2 (20).
    dept_id NUMBER);
    Table created.
    INSERT INTO emp_tab VALUES (30, 'Scott', NULL);
    1 line of creation.
    INSERT INTO emp_tab VALUES (31, 'Mary', NULL);
    1 line of creation.
    INSERT INTO emp_tab VALUES (40, 'John', NULL);
    1 line of creation.
    COMMIT;

    When I generate the XML code, you can find the output like below:
    < EMPLOYEE >
    < EMP_ID > 30 < / EMP_ID >
    Scott < NAME > < / NAME >
    < / EMPLOYEE >

    I just the Worklfow Developer's Guide and the example above was taken from Page 561 and 562 by looking at the DBMS_XMLGEN.setNullHandling using DBMS_XMLGEN procedure. DROP_NULLS as a parameter.

    Now, I understand the concept, but my requirement is a little different. I get a record as my procedure parameter PLSQL type, but requires the choice of a base table, which means maybe I have to insert first the folder I get as parameter in a table of basic and then select in the same when you set the context, which is what I don't want in the DBMS_XMLGEN.newContext. This is an additional burden.

    I've previously planned to use XMLELEMENT and XMLFOREST to generate the XML file (and was rather more simple), but this requirement to remove the tags altogether when the values are NULL led me to believe that maybe I might have to go down the path of using the API DBMS_XMLGEN.

    Can you suggest a better way, replacement to achieve what I want? Or perhaps give an example on how I can get there using XMLDB?


    Thank you and best regards,
    JD

    Can I use just the XMLElement and XMLForest to achieve?

    Sure. As said, XMLForest does not create elements for NULL values:

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb13gen.htm#ADXDB5006

    If the expression value is null, then no element is created for this expression.

    This is the code I wrote your above mentioned suggestion discussion forum

    Yes, but this solution is taken out of context.
    Here, it is obviously preferable to not generate empty items in the first place:

    SELECT XMLElement("Address"
           , XMLForest(
               lr_addr_rec.account_name     as "AccountName"
             , lr_addr_rec.address_line_1   as "Addressline1"
             , lr_addr_rec.lot_number       as "Addressline1"
             , lr_addr_rec.address_city     as "City"
             , lr_addr_rec.address_state    as "State"
             , lr_addr_rec.address_postcode as "PostCode"
             )
           )
    FROM dual;
    
  • Find, edit, and remove the tag XML (Adobe InDesign Server CS5)

    Hi all

    I work with Indesign CS5 server and JavaScript, although having some difficulties to come with a solution to a problem...

    I have to build a script JS (called through SOAP) that will allow me to search for an XML tag in an InDesign file.

    After you find the XML tag, if the variable 'action' is set to remove, it should remove the tag and its content.

    If the action is set to edit, he should change the content of the tag to the user-defined content.

    The main warning is that the XML tag is variable, as is the XML of the InDesign file structure.

    Here's what I have in mind, in pseudocode:

    function findXMLTag (tag, action) {}

    app.searchForTag (tag);

    If {(tagIsFound)

    If (action == 'delete') {}

    tag. Delete;

    } Else if (action == 'edit') {}

    tag.contents = "update content";

    }

    }

    }

    Any help would be greatly appreciated!

    Thank you

    Ben Kay

    'searchForTag' can be implemented as a recursive function.

    Recursion is defined as follows: I thought: "I'll just get this forum for"recursion"." The first post I found was one of my own, which suggests that the poster should search the forum for "recursion".

    Here is an example: find the XML element []

    And another: remove the xml using JS [CS3] element (read carefully, as the OP is stuck on how to remove an item and continue successfully)

    And the other using XML rules - which I am quite familiar with, but may work for you: changing values in XML tags

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

  • Incorporation of data inline HTML in XML using the &amp; lt; MX:XML &amp; gt; tag with &amp; amp; Lt; and &amp; amp; GT;

    What is best practices for integrating HTML in the tag < mx:XML >? Programmatically, I can successfully implement this:

    [Bindable]
    public var xmlDP:XML = < data component = "" & lt; "/ >;"

    However, I get the following error if I try to keep the same data row in a mx:XML tag, as such:

    < mx:XML id = "xmlDP" >
    < data component = "" & lt; "/ >"
    < / mx:XML >

    Error #1095: XML parser failure: attribute not completed.

    If I modify as follows the MXML tag, it works fine:

    < mx:XML id = "xmlDP" >
    < data component = "& amp; Lt; "/ >
    < / mx:XML >

    Unfortunately, I also can I supply not the tag mx:XML to a XML file which uses & lt; or & gt; the codes, because it gives the same results. This leads me to believe that the < mx:XML > tag does not support special character codes for < and >, but why?

    Either way, this code also gives an error 1095:

    < mx:XML id = "xmlDP" >
    < data component = "" & #0060; "/ >"
    < / mx:XML >

    A problem with my data source because it is not hand typed in Flex, and the XML standard supports the & lt; and & gt; codes. I tried a string of HTML complete, as shown below, but it also generates the error:

    < mx:XML id = "xmlDP" >
    < data component = "& lt; b & gt; Test & lt; /b & gt; "/ >
    < / mx:XML >

    Thank you very much for any input that you may have!

    This:
    "has the same problem, the.<" gets="" parsed="" by="" the="" mxml="" parser="" long="" before="" the="" "escape"="" has="" any="" meaning="" at="">

    Your last example XMLDeclaration com Tower has come full circle: it is him even that you posted in your first post and still has the same problem. This is not a bug in the compiler.

    I advise the encoding of special characters using the form URL (%), then use escape() to decode the attribute values.

    Tracy

  • Remove the tags in Windows Photo Gallery

    This question is about the photo gallery Windows on a Vista operating system. My question is about the drop-down auto-liste of tags that grows each time you enter a new tag. Handy if you want to use something you've used before but a nuisance if you want to erase it. I figured out how to remove tags on the pictures still on the computer. My question is about the images that have been deleted and is not recoverable. There is always this tag leftover junk that applied to these photos that I deleted. appears whenever you try to add a new tag and resists all efforts to remove it. I contacted gateway computer people since they installed the operating system and got the solutions really wild just to remove the unnecessary tags. I thought that everything you enter, you should be able to delete... just... but this has proved to be a great puzzle. I hate to have to do a restore to original factory specifications and lose everything I've added to this day to get rid of these pesky tags. In addition, it simply repeats the problem unless I have find how to remove the little monsters.

    I hope someone can help...

    Hi Jo,.

    It's a good thing to be careful when you edit the registry.  In your case, as the registry key seems to be very specific to the Windows Photo Gallery, we can export the folder safely we are change.  Be sure to close the Windows Photo Gallery before you start.

    • Click the ball to Start .
    • Type regedit in the box start the search.
    • Navigate through the folders on the left at the following key:

    HKEY_CURRENT_USER\Software\Microsoft\Windows Gallery\Library\PreviewPane\LabelAssignment\MRU photo

    • Right click on the folder MRU in the left hand window and choose export.
    • Give it a file name (no matter what you name it) and save to the desktop.
    • In the right window, you will see keys named MRU00, MRU02, MRU03 etc...
    • Right-click on these keys and click on delete.

    Once you are finished, close the registry editor by clicking the x in the upper right and restart your computer.  When she returns to the top, open the Windows Photo Gallery and see if the tags are gone.

    If you receive errors of ANY opening of photo gallery, simply, do a right click on the file that you have already saved on the desktop and choose Import.  That will undo any changes that we have made.

    Please let me know if that helps.

    Standard WARNING:
    Change the settings of the REGISTRY can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the REGISTRY settings configuration can be solved. Changes to these settings are at your own risk...

    Brent
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • 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 to remove unnecessary files from my mac computer?

    HW to remove unnecessary files from my computer without following these instructions

    MacKeeper

    Human inside

    Results of the analysis of your Mac arrived.

    The State of your system is:

    seriously

    MacKeeper found in:

    327 items

    The amount of junk mail on your Mac is:

    507 bytes

    5 cleaning
    Elements

    1 security
    Elements

    Optimization 0
    Elements

    Activate MacKeeper

    We strongly recommend that set you all the found items. Otherwise, you may experience:

    5 cleaning items

    1 security features

    Low because of unnecessary files disk space

    Theft of personal data:
    user names, passwords.
    credit card

    Already set free: 321 items.

    Activate MacKeeper
    Best regards
    Constantin
    Your Apple certified
    Technical support engineer
    1 (888) 572-5876 1 (800) 462-715 0 (808) 189-1280
    This e-mail has been sent to *.
    Please add [email protected] to your address book to ensure our emails reach your Inbox.

    If you prefer not receiving news from us, here is the link to unsubscribe.
    To change your communication preferences, use this link. Kromtech Alliance Corp., Richmodstrasse 6, 50667 Cologne, Germany Privacy policy

    Remove MacKeeper rather - we know junkware that will try to entice you to pay money, the company has had several lawsuits against it for their business practices.

    http://AppleInsider.com/articles/15/08/10/MacKeeper-to-pay-out-2m-in-proposed-CL ass-action-regulation

    Ignore it and delete the app. Where you get/download MacKeeper?

Maybe you are looking for

  • PHOTOSMART HP 5510

    NO GREAT PROBLEM NOT PHOTOS EPRINT. TO PRINT, FOR EXAMPLE, EMAILS ON SCREEN MESSAGE TO BED "CAN ONLY PRINT ON PRINTER SAMSUNG.

  • XPRT: XPRT there MOTOBLUR?

    I want to start a MyMotoblur account, but on the page of setup required for your business. Sprint is not listed. Does this mean the the XPRT is unable to connect to the MyMotoblur?

  • Update BIOS

    I've recently updated my BIOS on my laptop and it has changed some of the controls as I have to hold the Fn to set the volume and the brightness up and down. When I press the brightness button without holding the Fn, he acts as the arrows at the top

  • How to make the updates of operating system for the limited user account?

    original title: how to make the updates of operating system for the limited user account?  Limited user account cannot access the Windows Update page, see instead cautioned against MS the most recent must be installed. XP Pro SP3 slipstreamed.  New a

  • copy the calendar of events

    Hi friends, Is it possible to copy the calendar to my application blackberry event?, how? Thanks in advance