A parameter of xmltype extraction problem

Hello
I am using oracle 11g and I am trying to use an xmltype as input to an SP parameter, here's my SP:

create or replace PROCEDURE ABC
(FE_Param OF XMLType)
AS
BEGIN
I'm IN
(
SELECT XMLTYPE. EXTRACT (VALUE (a),
' Root/FE_ID/text()').getstringval (LIKE FE_ID)
TABLE
(XMLSEQUENCE (FE_Param.EXTRACT
("/ FEData/Root")
) ) a )

LOOP
INSERT INTO table1
VALUES (i.FE_ID);
END LOOP;

The XML parameter looks like this:
<? XML version = "1.0" encoding = "utf - 8"? >
< FEData >
< root > < FE_ID > 900000031 < / FE_ID >
< FE_ID > 900000032 < / FE_ID > < FE_ID > 900000050 < / FE_ID > < / root > < / FEData >

Triple post - what's happened? :-)

Published by: Kim Berg Hansen on August 22, 2011 16:47

Tags: Database

Similar Questions

  • XMLType.extract changes data?

    declare

    l_xml xmltype.

    l_xml2 xmltype.

    Start

    l_xml: = xmltype.createxml (xmlData = > bfilename ('XMLDIR2', 'demo.xml'),)

    CSID = > 0,

    schema = > null);

    l_xml2: = l_xml.extract('/UNIVERSITY/PKU/DEP/ART');

    dbms_output.put_line (l_xml. GETSTRINGVAL);

    l_xml2: = l_xml.extract('/UNIVERSITY/PKU/DEP/ART');

    dbms_output.put_line (l_xml. GETSTRINGVAL);

    end;

    the outputs are

    UNIVERSITY <>

    < PKU >

    < num DEP = "3" >

    < ART / >

    < AUTO / >

    < CHEMICAL / >

    < / DEP >

    < / ECP >

    < TSINGHUA >

    < DEP num = "2" >

    < BUILDING / >

    < AUTO / >

    < / DEP >

    < / TSINGHUA >

    < PKU >

    < num DEP = "3" >

    < ART / >

    < AUTO / >

    < CHEMICAL / >

    < / DEP >

    < / ECP >

    < TSINGHUA >

    < DEP num = "2" >

    < BUILDING / >

    < AUTO / >

    < / DEP >

    < / TSINGHUA >

    < / UNIVERSITY >

    UNIVERSITY <>

    < PKU >

    < num DEP = "3" >

    < ART / >

    < AUTO / >

    < CHEMICAL / >

    < / DEP >

    < / ECP >

    < TSINGHUA >

    < DEP num = "2" >

    < BUILDING / >

    < AUTO / >

    < / DEP >

    < / TSINGHUA >

    < PKU >

    < num DEP = "3" >

    < ART / >

    < AUTO / >

    < CHEMICAL / >

    < / DEP >

    < / ECP >

    < TSINGHUA >

    < DEP num = "2" >

    < BUILDING / >

    < AUTO / >

    < / DEP >

    < / TSINGHUA >

    < PKU >

    < num DEP = "3" >

    < ART / >

    < AUTO / >

    < CHEMICAL / >

    < / DEP >

    < / ECP >

    < TSINGHUA >

    < DEP num = "2" >

    < BUILDING / >

    < AUTO / >

    < / DEP >

    < / TSINGHUA >

    < / UNIVERSITY >

    Cat demo.xml

    UNIVERSITY <>

    < PKU >

    < num DEP = "3" >

    < ART / >

    < AUTO / >

    < CHEMICAL / >

    < / DEP >

    < / ECP >

    < TSINGHUA >

    < DEP num = "2" >

    < BUILDING / >

    < AUTO / >

    < / DEP >

    < / TSINGHUA >

    < / UNIVERSITY >

    It seems l_xml changed every time an excerpt is called, why? Thank you very much!!!

    Hello

    I have the same problem on this version:

    BANNER

    --------------------------------------------------------------------------------

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    PL/SQL Release 11.2.0.1.0 - Production

    CORE 11.2.0.1.0 Production

    AMT for 64-bit Windows: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production

    5 selected lines.

    The problem seems to use createxml and getstringval:

    declare
    
      l_xml   xmltype;
      l_xml2  xmltype;
    
    begin
    
      l_xml  := xmltype.createxml(xmlData => bfilename('XMLDIR2', 'demo.xml'),
                                  csid    => 0,
                                  schema  => null);
    
      dbms_output.put_line('Run 1 (getstringval):');
      dbms_output.put_line(l_xml.getstringval);
      dbms_output.put_line('Run 2 (getstringval):');
      dbms_output.put_line(l_xml.getstringval);
      dbms_output.put_line('Run 3 (getstringval):');
      dbms_output.put_line(l_xml.getstringval);
    
    end;
    /
    

    Here is the result:

    Race 1 (getstringval):

    Race 2 (getstringval):

    Race 3 (getstringval):

    Replace getstringval with getclobval seems to fix the problem.

    By creating the xml as literal does not show the same problem.

    Probably a bug on this version.

    Kind regards.

    Alberto

  • XMLType.extract cannot display French special characters in the select statement

    Hello
    E characters (acute e) get distorted when they are retrieved from the
    XMLType column of an ordinary table.

    How can we solve correctly get the characters e (acute e)?

    We tried setting 'setenv NLS_LANG French_France.WE8ISO8859P1' and
    "setenv NLS_LANG French_France.WE8DEC" before loading the table.

    Database version:
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    The test sample case is as follows:
    --connect to any schema where you can store XMLType
    set long 2000;
    set pagesize 2000;
    set serveroutput on;
    --delete from test;
    drop table test;
    create table test (id number, xmldata XMLType);
    
    
    declare
    featureDescriptorXML  CLOB;
    xml_type XMLType;
    new_xml_type XMLType;
    myName varchar2(100);
    myName2 varchar2(100);
    myName3 varchar2(100);
    stmt varchar2(4000);
    begin
     featureDescriptorXML :=
     '<?xml version="1.0" encoding="UTF-8"?>' ||
     '<abc:TheFeature xmlns:' || 'de' || '="' || 'http://abc.klmno.org/fghde' || '" xmlns:abc="http://www.ghijklmn.net/abc"' ||
     ' xmlns:xyz="http://www.ghijklmn.net/xyz">' ||
     '<abc:Name>de:MyGénérique</abc:Name>' ||
     '</abc:TheFeature>';
     xml_type := xmltype(featureDescriptorXML);
     myName := xml_type.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal();
     dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from XMLType variable is ' || myName);
     -- can show French chars
    
     insert into test(id, xmldata) values(20, xml_type);
    
     stmt := 'select t.xmldata.extract(''/abc:TheFeature/abc:Name/text()'', ''xmlns:abc="http://www.ghijklmn.net/abc"'').getStringVal() from test t';
     execute immediate stmt into myName2;
     dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from XMLType column in 2nd version is ' || myName2);
     -- cannot show French chars
    
    
     stmt := 'select  t.xmldata from test t';
     execute immediate stmt into new_xml_type;
     myName3 := new_xml_type.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal();
     dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from first XMLType column and then from XMLType variable in 3rd version is ' || myName3);
     -- cannot show French chars
    
    end;
    /
    
    select t.xmldata.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal()
    from test t;
    -- Cannot show French chars
    
    
    select t.xmldata.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal() "myname"
    from test t;
    -- Cannot show French chars
    
    
    select t.xmldata.getCLOBVal() from test t;
    -- Cannot show French chars
    
    
    select t.xmldata from test t;
    -- Can show French chars
    Output is the following with setenv NLS_LANG French_France.WE8ISO8859P1
    and NLS_DATABASE_PARAMETERS are the following:
    SQL> select * from nls_database_parameters;
    
    PARAMETER                      VALUE
    ------------------------------ ----------------------------------------
    NLS_LANGUAGE                   AMERICAN
    NLS_TERRITORY                  AMERICA
    NLS_CURRENCY                   $
    NLS_ISO_CURRENCY               AMERICA
    NLS_NUMERIC_CHARACTERS         .,
    NLS_CHARACTERSET               WE8DEC
    NLS_CALENDAR                   GREGORIAN
    NLS_DATE_FORMAT                DD-MON-RR
    NLS_DATE_LANGUAGE              AMERICAN
    NLS_SORT                       BINARY
    NLS_TIME_FORMAT                HH.MI.SSXFF AM
    
    PARAMETER                      VALUE
    ------------------------------ ----------------------------------------
    NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY              $
    NLS_COMP                       BINARY
    NLS_LENGTH_SEMANTICS           BYTE
    NLS_NCHAR_CONV_EXCP            FALSE
    NLS_NCHAR_CHARACTERSET         AL16UTF16
    NLS_RDBMS_VERSION              11.2.0.2.0
    
    20 ligne(s) sélectionnée(s).
    Table creé.
    
    abc:Name value stored in VARCHAR2 variable from XMLType variable is
    de:MyGénérique
    abc:Name value stored in VARCHAR2 variable from XMLType column in 2nd version is
    de:MyGénérique
    abc:Name value stored in VARCHAR2 variable from first XMLType column and then
    from XMLType variable in 3rd version is de:MyGénérique
    
    Procdure PL/SQL terminée avec succès.
    
    
    T.XMLDATA.EXTRACT('/ABC:THEFEATURE/ABC:NAME/TEXT()','XMLNS:ABC="HTTP://WWW.GHIJK
    --------------------------------------------------------------------------------
    de:MyGénérique
    
    
    myname
    --------------------------------------------------------------------------------
    de:MyGénérique
    
    
    T.XMLDATA.GETCLOBVAL()
    --------------------------------------------------------------------------------
    <?xml version="1.0" encoding="DEC-MCS"?>
    <abc:TheFeature xmlns:de="http://abc.klmno.org/fghde" xmlns:abc="http://www.ghij
    klmn.net/abc" xmlns:xyz="http://www.ghijklmn.net/xyz">
      <abc:Name>de:MyGénérique</abc:Name>
    </abc:TheFeature>
    
    
    
    XMLDATA
    --------------------------------------------------------------------------------
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <abc:TheFeature xmlns:de="http://abc.klmno.org/fghde" xmlns:abc="http://www.ghij
    klmn.net/abc" xmlns:xyz="http://www.ghijklmn.net/xyz">
      <abc:Name>de:MyGénérique</abc:Name>
    </abc:TheFeature>
    We also tried affecting NLS_CHARACTERSET AL32UTF8
    by CHARACTER SET of ALTER DATABASE.
    the database is closed and restarted.
    But that did not help.

    Thank you

    Ok. Wasn't sure. Thank you for that clarification.

    .. .but please make an attempt with XMLTABLE XMLQUERY, XMLCAST (or CAST) and other XML functions that support XQuery and not to use the engine of 'old '... I hope that these features will keep things as it should...

    .. .If not... create an SR with support of Oracle on this issue. Changes, if you base your SR on these 'old' operators XML/SQL and functions that are her will not be able to help, mainly due to the fact that your last version and stuff like EXTRACT / getStringVal() etc. are announced officially discouraged in this 11.2.0.2.0 version. As far as I know the t.xmldata.extract, the xml_type.extract and the other syntaxes, outlaw count of 10.1 (although I know, he appealed to java / OO people kind).

    Published by: Marco Gralike April 5, 2011 19:50

  • XMLTYPE schemaValidate() problem...

    Hello world!

    I have a problem using the XMLTYPE.schemaValidate () procedure.
    Can someone help me with this problem?

    I always get the error: ORA-30937: no schema definition for 'COMPONENT_ID"("##local"namespace) in parent ' / P_WAFERLIST/PLATE [1].


    Here's what I did:
    _1) first of all, I created the following schema definition: _
    <?xml version="1.0"?>
    <xs:schema id="P_WAFERLIST" targetNamespace="http://portal.xxx.com/xsd_schemadefinitions/ecf/prop" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified">
      <xs:element name="P_WAFERLIST">
        <xs:complexType>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element name="WAFER">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="PARAMETERS" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="PARAMETER" nillable="true" minOccurs="0" maxOccurs="unbounded">
                          <xs:complexType>
                            <xs:simpleContent>
                              <xs:extension base="xs:string">
                                <xs:attribute name="NAME" form="unqualified" type="xs:string" />
                              </xs:extension>
                            </xs:simpleContent>
                          </xs:complexType>
                        </xs:element>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
                <xs:attribute name="COMPONENT_ID" form="unqualified" type="xs:string" />
                <xs:attribute name="SUBQTY" form="unqualified" type="xs:string" />
                <xs:attribute name="STATE" form="unqualified" type="xs:string" />
              </xs:complexType>
            </xs:element>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    _2) then I did a DBMS_XMLSCHEMA.registerSchema_
          DBMS_XMLSCHEMA.registerSchema ('http://portal.xxx.com/xsd_schemadefinitions/ecf/prop',
                                         sys.UriFactory.getUri ('http://portal.xxx.com/xsd_schemadefinitions/ecf/prop/ecf_property.xsd'),
                                         TRUE,
                                         TRUE,
                                         FALSE);
    _3) this is an example of XML file to reproduce the error: _
    <P_WAFERLIST xmlns="http://portal.xxx.com/xsd_schemadefinitions/ecf/prop">
      <WAFER COMPONENT_ID="C11026W01PE6" SUBQTY="22500" STATE="SPLIT">
        <PARAMETERS>
          <PARAMETER NAME="PARAMETER">PARA1_VALUE</PARAMETER>
          <PARAMETER NAME="PARAMETER">PARA2_VALUE</PARAMETER>
          <PARAMETER NAME="PARAMETER">PARA3_VALUE</PARAMETER>
        </PARAMETERS>
      </WAFER>
      <WAFER COMPONENT_ID="C11026W02PH1" SUBQTY="21700" STATE="SPLIT">
        <PARAMETERS>
          <PARAMETER NAME="PARAMETER">PARA1_VALUE</PARAMETER>
          <PARAMETER NAME="PARAMETER">PARA2_VALUE</PARAMETER>
          <PARAMETER NAME="PARAMETER">PARA3_VALUE</PARAMETER>
        </PARAMETERS>
      </WAFER>
      <WAFER COMPONENT_ID="C11026W05PG7" SUBQTY="24300" STATE="PRESENT">
        <PARAMETERS>
          <PARAMETER NAME="PARAMETER">PARA1_VALUE</PARAMETER>
          <PARAMETER NAME="PARAMETER">PARA2_VALUE</PARAMETER>
          <PARAMETER NAME="PARAMETER">PARA3_VALUE</PARAMETER>
        </PARAMETERS>
      </WAFER>
    </P_WAFERLIST>
    _4) and it is an example of code to reproduce the error: _
             //P_XML is of type XMLTYPE and contains the sample XML 
             l_info := P_XML.isSchemaValid ('http://portal.xxx.com/xsd_schemadefinitions/ecf/prop', 'P_WAFERLIST');
             //l_info = 1 --> as far as good...
             P_XML := P_XML.createSchemaBasedXML ('http://portal.xxx.com/xsd_schemadefinitions/ecf/prop');
             //No error until now
             P_XML.schemaValidate();
             //Performing the schema validation causes the error:
             //ORA-30937: No schema definition for 'COMPONENT_ID' (namespace '##local') in parent '/P_WAFERLIST/WAFER[1]'
    I really have no idea what is the problem and why the schemaValidate() procedure causes an error :-( The basic version is 10g

    I would be grateful for any help!
    Mike BR

    Published by: ups_mike on December 3, 2010 05:07

    Published by: mdrake on December 3, 2010 08:05
    Add formatting tags... Please try and examples of format in the future

    If you change the attributeFormDefault setting in the schema, it seems to avoid the bug. I don't know if it's a work of viaable around in your case, but you expliciy showing the qualities of each attribute, then the default value need not matter.

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> set echo on
    SQL> spool testcase.log
    SQL> --
    SQL> connect sys/oracle as sysdba
    Connected.
    SQL> --
    SQL> set define on
    SQL> set timing on
    SQL> --
    SQL> def USERNAME = XDBTEST
    SQL> --
    SQL> def PASSWORD = &USERNAME
    SQL> --
    SQL> -- def XMLDIR = &1
    SQL> --
    SQL> def USER_TABLESPACE = USERS
    SQL> --
    SQL> def TEMP_TABLESPACE = TEMP
    SQL> --
    SQL> drop user &USERNAME cascade
      2  /
    old   1: drop user &USERNAME cascade
    new   1: drop user XDBTEST cascade
    
    User dropped.
    
    Elapsed: 00:00:00.39
    SQL> grant create any directory, drop any directory, connect, resource, alter se
    ssion, create view to &USERNAME identified by &PASSWORD
      2  /
    old   1: grant create any directory, drop any directory, connect, resource, alte
    r session, create view to &USERNAME identified by &PASSWORD
    new   1: grant create any directory, drop any directory, connect, resource, alte
    r session, create view to XDBTEST identified by XDBTEST
    
    Grant succeeded.
    
    Elapsed: 00:00:00.03
    SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespa
    ce &TEMP_TABLESPACE
      2  /
    old   1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tabl
    espace &TEMP_TABLESPACE
    new   1: alter user XDBTEST default tablespace USERS temporary tablespace TEMP
    
    User altered.
    
    Elapsed: 00:00:00.00
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> -- create or replace directory XMLDIR as '&XMLDIR'
    SQL> -- /
    SQL> var SCHEMAURL1    varchar2(256)
    SQL> VAR XMLSCHEMA1    CLOB;
    SQL> VAR INSTANCE1     CLOB;
    SQL> --
    SQL> set define off
    SQL> --
    SQL> alter session set events='31098 trace name context forever'
      2  /
    
    Session altered.
    
    Elapsed: 00:00:00.00
    SQL> begin
      2    :SCHEMAURL1:= 'http://portal.xxx.com/xsd_schemadefinitions/ecf/prop';
      3    :XMLSCHEMA1 :=
      4  '
      5  
      6    
      7      
      8        
      9          
     10            
     11              
     12                
     13                  
     14                    
     15                      
     16                        
     17                          
     18                            
     19                              
     20                            
     21                          
     22                        
     23                      
     24                    
     25                  
     26                
     27              
     28              
     29              
     30              
     31            
     32          
     33        
     34      
     35    
     36  ';
     37    :INSTANCE1 :=
     38  '
    
     39    
     40      
     41        PARA1_VALUE
     42        PARA2_VALUE
     43        PARA3_VALUE
     44      
     45    
     46    
     47      
     48        PARA1_VALUE
     49        PARA2_VALUE
     50        PARA3_VALUE
     51      
     52    
     53    
     54      
     55        PARA1_VALUE
     56        PARA2_VALUE
     57        PARA3_VALUE
     58      
     59    
     60  ';
     61  end;
     62  /
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.00
    SQL> set define on
    SQL> --
    SQL> declare
      2    V_XML_SCHEMA xmlType := XMLType(:XMLSCHEMA1);
      3  begin
      4    DBMS_XMLSCHEMA.registerSchema
      5    (
      6      SCHEMAURL        => :SCHEMAURL1,
      7      SCHEMADOC        => V_XML_SCHEMA,
      8      LOCAL            => TRUE,
      9      GENBEAN          => FALSE,
     10      GENTYPES         => TRUE,
     11      GENTABLES        => FALSE,
     12      ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
     13    );
     14  end;
     15  /
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.64
    SQL> declare
      2    V_XML XMLTYPE := XMLType(:INSTANCE1).createSchemaBasedXML (:SCHEMAURL1);
      3  begin
      4    V_XML.schemaValidate();
      5  end;
      6  /
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.02
    SQL>
    

    Published by: mdrake on December 3, 2010 08:18

  • XMLType.extract: result of split

    Hello

    I use this function of the soap_api.sql for web services.
    FUNCTION get_return_value(p_response   IN OUT NOCOPY  t_response,
                              p_name       IN             VARCHAR2,
                              p_namespace  IN             VARCHAR2)
      RETURN VARCHAR2 AS
    -- ---------------------------------------------------------------------
    BEGIN
    
            RETURN p_response.doc.extract('//'||p_name||'/child::text()',p_namespace).getstringval();
    
    END;
    The problem is that it returns a large number of values, and they are all concatenated to the return value. Is there a way to divide all values with a separator or something?

    For example. It returns "TexasLos AngelesChicagoPhoenix" and I would like something like "Texas; Los Angeles; Chicago; Phoenix»

    I am using Oracle 11g

    Thank you

    Hello

    You can use the XMLQuery function and string-join (XPath 2.0).

    For example:

    SQL> DECLARE
      2
      3   xmldoc xmltype := xmltype(
      4  '
      5  Texas
      6  Los Angeles
      7  Chicago
      8  Phoenix
      9  '
     10  );
     11
     12   p_name      VARCHAR2(30) := 'city';
     13   p_namespace VARCHAR2(100) := 'test';
     14
     15   v_result    VARCHAR2(100);
     16
     17  BEGIN
     18
     19   select xmlcast(
     20    xmlquery(
     21     ( 'declare default element namespace "'||p_namespace||'"; (::)
     22       string-join(//'||p_name||'/child::text(),";")' )
     23     passing xmldoc
     24     returning content
     25    )
     26    as varchar2(100)
     27   ) into v_result
     28   from dual;
     29
     30   dbms_output.put_line(v_result);
     31
     32  END;
     33  /
    
    Texas;Los Angeles;Chicago;Phoenix
    
    PL/SQL procedure successfully completed
     
    

    It works well on 11.2, not sure about 11.1.

    Another way, by blocking the part extracted outside XQuery.
    Perhaps it fits better into your actual design:

    SQL> DECLARE
      2
      3   xmldoc xmltype := xmltype(
      4  '
      5  Texas
      6  Los Angeles
      7  Chicago
      8  Phoenix
      9  '
     10  );
     11
     12   p_name      VARCHAR2(30) := 'city';
     13   p_namespace VARCHAR2(100) := 'xmlns="test"';
     14
     15   v_result    VARCHAR2(100);
     16
     17  BEGIN
     18
     19   select xmlcast(
     20    xmlquery(
     21     'string-join(//text(),";")'
     22     passing extract(xmldoc, '//'||p_name, p_namespace)
     23     returning content
     24    )
     25    as varchar2(100)
     26   ) into v_result
     27   from dual;
     28
     29   dbms_output.put_line(v_result);
     30
     31  END;
     32  /
    
    Texas;Los Angeles;Chicago;Phoenix
    
    PL/SQL procedure successfully completed
     
    
  • Audio cd extraction problem with iTunes 12.5.1

    Using the latest version of El Capitan 10.11.6, end 2012 iMac i7 processor.

    Installed iTunes 12.5.1.21 the other day and now bad rip the CD itself. I tear like Apple Lossless with correction of error checked and have never had any problems before. Some I just new Herb Alpert CDs in the mail and each of them seemed to rip OK, but two starting to jump on other securities when read.

    For example, torn "Summertime" and the two-lane 1 jump during playback. I tried playback on the same ripped files with VLC, and they ignored in the same places, so it must be a file problem not just reading. Then I tried to play the CD with iTunes and without tearing, and it plays very well. Yet once torn and same problem. Had to extract a few tracks on "Volume 2" several times and they finally played OK. "" I think with error correction that this could not happen. Glance CD clean. In the past I had trouble with ripping a CD and still found a crack in the plastic and iTunes would not rip in this case.

    All the old files ripped off until I upgraded 12.5.1 plays perfectly just like always.

    Any suggestions? At the moment, hoping that this is a problem of system and the Sierra with Take Care of it.

    Me again with further troubleshooting. You wonder now if it's a hardware problem. With the help of a 4 year old Superdrive Apple USB. Tried to rip to my MacBook Air with the same drive, but using iTunes 12.4 and had still tracks will jump on playback. Put the CD into the stereo of my wife, and she played it perfectly.

    Confuses me because I thought (with correction of error during the rip) that if there is an error with the player, he would refuse to rip at all or to freeze. I agree that iTunes did freeze twice during a tear in the disc, but after having tried seemed to work OK.

    Should I be looking for a new drive?

  • XMLType extract help function

    I have the example of XML structure below.
    It has 2 child elements of type '< ns0:ItemMetaData >', has all first under element ' < ns0:ItemId > DSLGP603 < / ns0:ItemId > ' and second element sub "< ns0:ItemId > DSLGP603NY < / ns0:ItemId >.
    But it is the only example of 2 parts in stock, there may be 10 these xml inside the chain elements.
    How can I go/loop through all these elements '< ns0:ItemMetaData > '?
    I think I need to change this part:
    extract('//*'
    But I have not managed to change.

    --
    select *
      from xmltable ('*/text()'
                     passing xmltype ('<ns0:FindItemMetaDataResponse xmlns:ns0="http://elion.ee/webservices/Sales/Dynamics">
      <ns0:ItemMetaData>
        <ns0:ItemMetaData>
          <ns0:ItemGroupId>IT.LS.VS.DSL</ns0:ItemGroupId>
          <ns0:ItemGroupName>IT lisad võrguseadmed DSL</ns0:ItemGroupName>
          <ns0:ItemId>DSLGP603</ns0:ItemId>
          <ns0:ItemName>ADSL SIP ST546</ns0:ItemName>
          <ns0:ItemType>Item</ns0:ItemType>
          <ns0:MacAddressMandatory>No</ns0:MacAddressMandatory>
          <ns0:SalesUnit>tk</ns0:SalesUnit>
          <ns0:SerialNumMandatory>No</ns0:SerialNumMandatory>
          <ns0:TaxValue>20.00</ns0:TaxValue>
        </ns0:ItemMetaData>
        <ns0:ItemMetaData>
          <ns0:CurrencyCode>EUR</ns0:CurrencyCode>
          <ns0:ItemGroupId>KL.PS.HGW</ns0:ItemGroupId>
          <ns0:ItemGroupName>Ruuterid</ns0:ItemGroupName>
          <ns0:ItemId>DSLGP603NY</ns0:ItemId>
          <ns0:ItemName>ADSL stardikomplekt Thomson ST546 stardi</ns0:ItemName>
          <ns0:ItemType>Item</ns0:ItemType>
          <ns0:MacAddressMandatory>No</ns0:MacAddressMandatory>
          <ns0:PriceWithoutVAT>12.78</ns0:PriceWithoutVAT>
          <ns0:PriceWithVAT>15.34</ns0:PriceWithVAT>
          <ns0:SalesUnit>tk</ns0:SalesUnit>
          <ns0:SerialNumMandatory>Yes</ns0:SerialNumMandatory>
          <ns0:TaxValue>20.00</ns0:TaxValue>
        </ns0:ItemMetaData>
      </ns0:ItemMetaData>
    </ns0:FindItemMetaDataResponse>').extract('//*', 'xmlns="' || 'http://elion.ee/webservices/Sales/Dynamics' || '"')
                    )
    IT.LS.VS.DSL
    IT lisad võrguseadmed DSL
    DSLGP603
    ADSL SIP ST546
    Item
    No
    tk
    No
    20.00
    EUR
    KL.PS.HGW
    Ruuterid
    DSLGP603NY
    ADSL stardikomplekt Thomson ST546 stardi
    Item
    No
    12.78
    15.34
    tk
    Yes
    20.00
    select * from v$version;
    
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE     11.2.0.3.0     Production"
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

    Should I then run the function "extract()" for each element node "" ItemMetaData"" sub I guess?

    You can add other columns as you wish:

    SQL> with sample_data (doc) as (
      2    select xmlparse(document
      3    '
      4    
      5      
      6        IT.LS.VS.DSL
      7        IT lisad võrguseadmed DSL
      8        DSLGP603
      9        ADSL SIP ST546
     10        Item
     11        No
     12        tk
     13        No
     14        20.00
     15      
     16      
     17        EUR
     18        KL.PS.HGW
     19        Ruuterid
     20        DSLGP603NY
     21        ADSL stardikomplekt Thomson ST546 stardi
     22        Item
     23        No
     24        12.78
     25        15.34
     26        tk
     27        Yes
     28        20.00
     29      
     30    
     31  ')
     32    from dual
     33  )
     34  select x.*
     35  from sample_data t
     36     , xmltable (
     37         xmlnamespaces(default 'http://elion.ee/webservices/Sales/Dynamics')
     38       , '/FindItemMetaDataResponse/ItemMetaData/ItemMetaData'
     39         passing t.doc
     40         columns item_id   varchar2(30) path 'ItemId'
     41               , item_name varchar2(80) path 'ItemName'
     42       ) x
     43  ;
    
    ITEM_ID                        ITEM_NAME
    ------------------------------ --------------------------------------------------------------------------------
    DSLGP603                       ADSL SIP ST546
    DSLGP603NY                     ADSL stardikomplekt Thomson ST546 stardi
     
    
  • XMLType extract query

    Hello:

    How to change the following query to get only the element with a given person_id? Actually, I have a CLOB containing an XML document. I thought that step 1 is to create a view, or something that casts of this column to an XMLType object, so I do that in the data of test here as well. If I do not need to do, it makes it very well.
    with base as ( -- Base XML
        select '<?xml version="1.0" encoding="UTF-8"?>
        <person_record_set>
        <person>
        <lname>Doe</lname>
        <fname>John</fname>
        <person_id>12345</person_id>
        </person>
        <person>
        <lname>Smith</lname>
        <fname>John</fname>
        <person_id>54321</person_id>
        </person>
        <person>
        <lname>Jones</lname>
        <fname>Mary</fname>
        <person_id>33333</person_id>
        </person>
        </person_record_set>' bdata
    from dual
    ),
    Q1 as ( -- We want it as an XMLType
    select xmltype(bdata) xtdata 
    from base)
    -- End of test data setup
    select '<rows>' || extract(xtdata,'//person') || '</rows>' from Q1
    Thank you

    You can use conditions on the xpath:

    with q1 as (select xmltype('
        
        
        Doe
        John
        12345
        
        
        Smith
        John
        54321
        
        
        Jones
        Mary
        33333
        
        ') xtdata from dual)
    -- End of test data setup
    select '' || extract(xtdata,'//person[person_id=12345]') || '' from Q1
    

    I don't like particularly the addition of '', though; that's what you do with this data? There are probably better ways to do this.

    Published by: Boneist on May 16, 2012 14:55

  • Parameter is incorrect compilation problem

    Hello

    I am really pulling my hair on it.  I have a flex using Flash Builder 4.5.1 project that uses the BlazeDS remoting services.

    I run my Flash Builder inside an Oracle VirtualBox VM (Windows XP) because I am a user of Ubuntu.  I was fortunately compilation and deployment for a couple of months without hassle.

    Recently I got a new laptop.  I have my VM has exported and imported on the new laptop.  All of a sudden my project when compiling gives me an error: 'the parameter is incorrect' location 'unknown '.

    If I create a simple project from scratch, it compiles very well without any problems.  I can then navigate to my service of BlazeDS, add it - but as soon as I am referring to this service in my component - the component compiles well but on the project level, it gives the above error.

    I've looked everywhere for a more detailed version of the error: but nothing.

    Help please!


    Rgds,

    Willem.

    So for those interested, I solved this problem by creating another vacuum of virtual Windows machine, reinstall Flash Builder and re-import my project.

    It seems that Adobe Flash Builder has built something obscure that dislikes you migrate a virtual computer to another host.  I did unregister and re - register my product between the virtual machine, incidentally - that does not work.

  • XMLTYPE extract some nodes

    Hello
    < book >
    < book >
    < id > 12 / < ID >
    Oracle < name > < / name >
    < / book >
    < book >
    < id > 15 / < ID >
    < name > net < / name >
    < / book >
    < / books >

    Please how can I retrieve the node containing the oracle book without the order of the element, in 10 g and 11 g

    I mean that the result should be

    < book >
    < id > 12 / < ID >
    Oracle < name > < / name >
    < / book >

    Thanks in advance

    How about using the EXTRACT with following XPath function? :
    book/books / [name = 'oracle']

    The whole sample test case:
    ------------------------------------------------------------
    CREATE TABLE testtab)
    ID NUMBER PRIMARY KEY,
    XML XMLTYPE
    );
    INSERT INTO testtab VALUES (1, XMLTYPE ('))

    12
    Oracle


    15
    NET

    '));
    COMMIT;

    SELECT EXTRACT (xml, '/ books/book [name = "oracle"]') FROM testtab;
    ------------------------------------------------------------

  • DataControl drag-and - d├⌐poser - parameter of method return problem! ******

    Hello

    This is a fundamental question of DataControl where I am facing some problems because of this.

    I created the form java webservice DataControl and using this CD in my application of ADF. When I do drag my RESULT of data control in my UI and select a specific output structure (Table or form or etc.), it's pop - up window with all the settings back where I can enter lables and hit the OK button.

    Pressing OK button a few times it's pop up the next window where I can see the name of DataControl on top and the parameters of input method list at the bottom of the window and I can enter the value of my input fields. But very shortly, I get this popup window 2. Not every time where after, press the OK button in the first window directly, is create the table / form in the user interface.

    But I need to this 2nd window or popup inorder to postpone my mandatory in all of my request input parameters. Please help me why I do not get this list of input methods sometimes. Or is there any other file I can change and set the input parameter binding method? It's really useful to solve one of my large project problem. Help please...

    Thank you
    klogube

    Hello

    Right-click on your jspx and open the pagedef for the page.

    In the pagedef, select the methodAction and edit (pencil icon), where you can specify values for the parameters of the method.

    HTH.

    Arun-

  • extraction problems

    Hello, I downloaded a patch for a game, but can not extract the file.  I click on extract all, it tells me there is already a folder with the same name (which is not true), so I click on ignore, then it asks me if I want to repalce content of the file - click on Yes, then encryption warning, then error code0x80004005.  Help!

    It comes with Vista, upgrade install and activate Forum

    I suggest that you contact the game manufacturer.

    Alternatively, post in the gaming Forum.
    If would help them here, if you also included the name of the game when you repost here!

    http://social.answers.Microsoft.com/forums/en-us/vistagaming/threads

    See you soon.

    Mick Murphy - Microsoft partner

  • Boolean parameter in utl_url.escape problem

    Hello

    I try to use under query with 2nd parameter as TRUE, but I am getting below error.

    Select utl_url.escape (url = > 'http://www.sample.com/ umlat.php & \^#q=name', escape_reserved_chars = > TRUE); double

    Error:

    [Error] Run (16:100): ORA-00904: "TRUE": invalid identifier

    I should pass the parameter as the value TRUE (default is FALSE)

    Can anyone support me for more come from this issue.

    FYI - I tried creating a user-defined function and it works fine but I want to use directly in a SELECT statement using the function.

    This isn't a matter of Oracle text, but I can answer probably anyway.

    'TRUE' is a PL/SQL expression to a Boolean data type.  There is no Boolean data type in SQL. Therefore, it is not possible to directly call a PL/SQL procedure, requiring a Boolean parameter from a select SQL query.  You need to encapsulate in a procedure using single SQL data types, as you suggested.

  • extracted - problem button close this window

    I noticed that the extract of "window button" close (on form elements) has redundent javascript that stop working.  #1 extract original doesn't not work.  #2 done.

    #1 < input type = "button" value = "close window" onclick = "javascript:self.close();" onKeyPress = "javascript:self.close();" ">

    #2 < input type = "button" value = "close window" onclick = "javascript:self.close()" / > "

    Anyone else notice this?

    One is designed to allow keyboard users to can click any key when this element is to close the window, rather than forcing the use of a mouse click.

    As you transcribed it here it is indeed wrong.  That's your mistake or how you found it? :

    onclick = "JavaScript:Self.Close();" onKeyPress = "javascript:self.close();" » >

    should be

    onclick = "JavaScript:Self.Close();" "onKeyPress =" javascript:self.close(); " » >

    with this quote in added

    --

     E. Michael Brandt
    
    www.divahtml.comwww.divahtml.com/products/scripts_dreamweaver_extensions.phpStandards-compliant scripts and Dreamweaver Extensions
    
    www.valleywebdesigns.com/vwd_Vdw.aspJustSo PictureWindowJustSo PhotoAlbum, et alia
    
    --
    
  • How to pass parameter in the function extract (for XMLTYPE)

    I have a table with XMLTYPE field xml_column PROBLEMXML. In this column, there are many deffinitions for the problem. There is no amount deffinitions max and there can be no definition at all. I need to return all the definitions of all the problems a string wirh separate definitions by '; '.

    Query
    SELECT extract (prob. Def,'/definitions/definition[1]/@var'). ';'|| excerpt (prob. Def,'/definitions/definition[2]/@var')
    OF PROBLEMXML j.
    XMLTABLE)
    "/ problem.
    PASSAGE j.xml_column
    Probid VARCHAR COLUMNS (31) PATH ' / problem/@id',
    Prob def XMLTYPE PATH ' / problem/definitions ")
    where PROBLEM_ID = 1;
    Returns exactly what I want one; m.
    But
    declare
    my_variable varchar2 (2000): = null;
    number of N1;
    number of N2;
    Start
    N1: = 1;
    N2: = 2;
    SELECT extract (prob. Def,'/definitions/definition[N1]/@var'). '|'|| excerpt (prob. Def,'/definitions/definition[N2]/@var') in my_variable
    OF ETL_PROBLEMXML_STG_T j.
    XMLTABLE)
    "/ problem.
    PASSAGE j.xml_column
    Probid VARCHAR COLUMNS (31) PATH ' / problem/@id',
    Prob def XMLTYPE PATH ' / problem/definitions ")
    where PROBLEM_ID = 1;
    dbms_output.put_line ($my_var);
    end;
    Returns null.
    Is there a way to switch the setting to extract the function?

    You have string literal death of n1 and n2. Note the change to select it.

    DECLARE
      my_var VARCHAR2(2000) := NULL;
      n1     NUMBER;
      n2     NUMBER;
    BEGIN
      n1 := 1;
      n2 := 2;
      SELECT extract(prob.def, '/Definitions/Definition[' || n1 || ']/@var') || '|' ||
             extract(prob.def, '/Definitions/Definition[' || n2 || ']/@var')
        INTO my_var
        FROM etl_problemxml_stg_t j,
             xmltable('/problem' passing j.xml_column columns probid VARCHAR(31) path '/problem/@id',
                      def xmltype path '/problem/Definitions') prob
       WHERE problem_id = 1;
      dbms_output.put_line(my_var);
    END;
    

    Published by: RPuttagunta on December 13, 2010 09:18

Maybe you are looking for

  • Why web pages automatically opens?

    I hope it is easy. Don't know what happened, but when I select a Web site address in the browser, this page does not open automatically. I have to click the arrow on the far right of this field, then the page opens. How can I set this up so that page

  • processor and motherboard too hot!

    Help, please! I recently bought a HP Pavilion Sleekbook 14-b065tx. It came with the BACK. So I installed win 8.1 on it. everything works quickly and smooth that I love him.  but I have istalled speccy and checked the temprature, that I'm typing this,

  • HP CQ61: I have NEED of HELP TOO

    Can help me my laptop 61794694 deactivation code

  • STOP: 0X0000009F

    I get a blue screen with STOP: 0x0000009F (followed by a variety of other code) by playing games, Microsoft, usually after that I used a browser (explore, Firefox or Opera).  This started about 5 months ago and is spending more and more frequently. T

  • Vista and sleep/hibernate implementation

    My computer laptop compaq work properly since last year.   In the last two weeks he has stopped responding to orders to wake from sleep mode.  If it is for more than 10 minutes the screen becomes white and that's the last you will see of it.  The onl