Multilingual in XMLTYPE problem

Hi Experts,

My database as follows:

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

PL/SQL Release 11.2.0.3.0 - Production

CORE Production 11.2.0.3.0

AMT for Linux: Version 11.2.0.3.0 - Production

NLSRTL Version 11.2.0.3.0 - Production

WE8ISO8859P1 NLS_CHARACTERSET

IM XML storage in one of the table in my database in the XMLTYPE column. But when my XML node contains a multilingual value (Ex: Chinese) is to show the Junk value. Is it possible to store it's?

INSERT IN web_xml_file (file_no, web_file_data, record_status, user_created, created) VALUES (v_file_no, xmltype.createxml (p_in_xml), "UNP", USER, SYSDATE);

NUMBER FILE_NO,

XMLTYPE OF the WEB_FILE_DATA,

RECORD_STATUS VARCHAR2 (3),

MSG_ERREUR VARCHAR2 (4000).

USER_CREATED VARCHAR2 (50).

DATE OF CREATION,

USER_CHANGED VARCHAR2 (50).

MODIFICATION DATE

The following seems to work but be aware, that this is still a hack and certainly not bulletproof.

The best way to handle this is to have the AL32UTF8 migrated db character set, or the external analysis.

Select utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (skywardsnumber), 'AL32UTF8') as skywardsnumber

utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (title), "AL32UTF8") as the title

utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (firstname), "AL32UTF8") as a first name

utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (familyname), "AL32UTF8") as familyname

from xmltable ('/ data/passengerinformation ')

from xmltype (dbms_xslprocessor.read2clob ('XML_DIR', 'multi.xml', nls_charset_id('CHAR_CS')))

path of columns skywardsnumber varchar2 (100) 'skywardsnumber '.

, title varchar2 (100) path 'title '.

, path of varchar2 (100) firstname "firstname".

, familyname varchar2 (100) path "familyname".

) x ;

Explanations:

(1) I put your example of XML in a file saved with UTF-8 encoding and it shipped to a database directory (DOC_DIR).

(2) I have access to the file as CLOB using DBMS_XSLPROCESSOR.read2clob, and (here's the trick) considering the file in the db character set (mine was WE8ISO8859P15). Accordingly, all multibyte characters are converted into single-byte characters in the DB character set.

(3) I use the XMLType constructor to construct an instance of XMLType off the CLOB and analyze with XMLTABLE.

(4) who gives me four columns which I then convert into sequences of bytes (utl_i18n.string_to_raw) and finally to NCHAR (utl_i18n.raw_to_nchar) by specifying the encoding of the original file.

Tags: Database

Similar Questions

  • Excerpt from XMLType problem with different namespaces

    Hello

    I need some advice on how to extract the child element to the XML fragment where the parent namespace differs child name space. I have done the broad research and I've tried several options but have had no success.

    This is fragment plsql sample

    vTheXML: = XMLType ("< GeneratedDocument xmlns ="http://tempuri.org/"> ")

    " < file_name xmlns =" http://services.DPM.com.au/intelledox/ "> Test.pdf < / Filename > .

    (< / GeneratedDocument > ');

    Below successfully returns a GeneratedDocument element (IE any fragment)

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument ',' xmlns = "http://tempuri.org/"');

    But none of below works. They return null. I do not know how to represent the different namespaces in the function call retrieves XMLType

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument/filename ',' xmlns = "http://services.dpm.com.au/intelledox/"');

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument/filename ',' xmlns = "http://tempuri.org/"xmlns ="http://services.dpm.com.au/intelledox/"');

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument/filename ',' xmlns = "http://tempuri.org/"');

    Below works, but would ideally use more precise criteria of XPath

    vExtractXML: = vTheXML.extract ("/ / filename ',' xmlns ="http://services.dpm.com.au/intelledox/"'");

    Thank you

    Hello

    Of course, you cannot declare two namespaces by default in the namespace mapping, use at least a prefix to distinguish them:

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument / ns1:FileName ',' xmlns = "http://tempuri.org/" xmlns:ns1 = "http://services.dpm.com.au/intelledox/"');

    (NB: extract and extractvalue, etc. have been deprecated in 11.2)

  • ScanJet software installs in German rather than English - a Windows 7 problem

    I am trying to install HP Scanjet full feature and Driver for Windows 7 (32 bit) for my ScanJet G4010.

    On the software download page I choose English (American) and then downloaded setup_full_G4010_14 - 5.exe.

    My Windows 7 is in English.  EN is shown it is stated in the taskbar.  And to be sure, I went to the United States as my current location.  However setup_full_G4010_14 - 5.exe launched in German.  It offered no language option during installation.  The clean install HP G4010-is in German and offers no language option.

    How can this be?  Well, I'm in Germany.  I don't see how the installer or the installed software could not understand that I am in Germany, but the HP site could.  Has made the website to slip me a German version of setup_full_G4010_14 - 5.exe despite my choice of a version to English?

    A small experiment proved that my system Windows 7, not the site of HP, is the source of trouble.  I ran the downloaded file setup_full_G4010_14 - 5.exe even on a Windows XP system and the installation program launched in English.  The Windows 7 software and then installed on the Windows XP system, in English.

    This shows that the setup_full_G4010_14 - 5.exe is multilingual, and my problem is that it incorrectly detects my Windows 7 as German.  The software installed is not multilingual.  I checked this glancing in an installed help file .xml in the Windows 7 install.  It's in German.

    How can I get setup_full_G4010_14 - 5.exe HP to think that my Windows 7 is in English?

    Hello

    Open the Control Panel, then go to the language and region.

    On the Format tab, make sure that your PC is set to English.

    Then, open the administration tab and verify that the local system is set up in English and not German.

    Now restart your PC, open the HP software and check any change.

    Please let me know if this is useful,

    Shlomi

  • XDB. XMLIndex problem and table (XMLSEQUENCE (EXTRACT (xmltype, path))

    Hello
    I have a database of Oracle 11 g Release 11.1.0.6.0 - 64 bit Production With the Real Application Clusters option.

    I feel something strange with an XMLType column.
    I have a table configurator.t_vehicle_configuration (id_vehicle x_configuration NUMBER, XMLType).
    x_configuration is unstructured.

    I created an index on the field of xml in this way:

    CREATE INDEX idx_vehicle_configuration ON configurator.t_vehicle_configuration (x_configuration) INDEXTYPE IS XDB. XMLIndex;

    Then I have a package implementing a function that count nodes in the xml field and its return values

    This does not (return 0 instead of 1):
        SELECT count(*)
          INTO count_
          FROM configurator.v_vehicle_configuration vc,
               table(XMLSEQUENCE(EXTRACT(vc.x_configuration, '/vehicleconf/GeoFence/spaceTarget[@id="'||in_id_space_target||'"]/user[@id="'||in_id_user||'"]/alarmwhen'))) p
         WHERE vc.id_vehicle = in_id_vehicle;
        
        RETURN count_;
    This mode of operation (return 1):
        str_ := '/vehicleconf/GeoFence/spaceTarget[@id="'||in_id_space_target||'"]/user[@id="'||in_id_user||'"]/alarmwhen';
    
        SELECT count(*)
          INTO count_
          FROM configurator.v_vehicle_configuration vc,
               table(XMLSEQUENCE(EXTRACT(vc.x_configuration,str_))) p
         WHERE vc.id_vehicle = in_id_vehicle;
        
        RETURN count_;
    As this mode of operation:
        SELECT /*+ NO_XMLINDEX_REWRITE */ count(*)
          INTO count_
          FROM configurator.v_vehicle_configuration vc,
               table(XMLSEQUENCE(EXTRACT(vc.x_configuration, '/vehicleconf/GeoFence/spaceTarget[@id="'||in_id_space_target||'"]/user[@id="'||in_id_user||'"]/alarmwhen'))) p
         WHERE vc.id_vehicle = in_id_vehicle;
        
        RETURN count_;
    And also this way it works:
        SELECT count(*)
          INTO count_
          FROM configurator.v_vehicle_configuration vc,
               table(XMLSEQUENCE(EXTRACT(vc.x_configuration, '/vehicleconf/GeoFence/spaceTarget[@id="228"]/user[@id="49"]/alarmwhen'))) p
         WHERE vc.id_vehicle = in_id_vehicle;
        
        RETURN count_;
    I sailed a bit on the internet but I have found no help for my problem...
    I guess that's something concerning the substitution on the fly of the variables, which does not work with an index.
    Do you have any suggestions?
    Is there a way that will prevent the rewriting of all the functions?

    Thanks in advance

    First

    On 11.1.0.6.0 Please do not use table (xmlsequence (extract ())) Please use the SQL/XML standard XMLTAble operator...

    SELECT COUNT(*)
       INTO count_
      FROM configurator.v_vehicle_configuration vc,
               XMLTABLE
              (
                  '$XML/vehicleconf/GeoFence/spaceTarget[@id=$ID_SPACE_TARGET]/user[@id=$ID_USER]/alarmwhen'
                  passing vc.x_configuration as "XML",  in_id_space_target as "ID_SPACE_TARGET",  in_id_user as "ID_USER"
               )
         WHERE vc.id_vehicle = in_id_vehicle;
    
        RETURN count_;
    

    2. never generate XPATH strings dynamically (Note XMLTABLE simply will not allow it). It is almost impossible to optimize since in the case escalated, the query may be a function of the processing line, and it leaves the vulnerable application WHO the problems of injection. Earlier versions of XML DB supported the use of string concatenation technique to provide the value of predicate as a method of implementation of the bind variable, but from what I remember, this is only implemented and tested for storage relatiion object. Even when workng with storage relational object this technique should not be used in the development of new code n a 10.2.x post database. As far as I know this was not implemented for binary XML / XML INdex since the implementations of XMLQUERY, XMLTable and XMLEXists provided a much more robust implementation and standardized to link the underlying values at query runtime

    If you do not know the XPATH expression until run time please build the complete SQL statement dynamically and run it via EXECUTE IMMEDIATE or DBMS_SQL, then pay attention to injection vunerabilities in your application.

    The fact that you get different results seems to be the result of the previous method of binding of predicates works do not correctly with the XML Index. If the solution I gave above does not work, please fill out a bug and that we can continue the investigation

    Published by: mdrake on February 25, 2011 17:32

  • 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

  • problem with 'xmltype.existsnode '.

    Hi people,

    I'm trying to download a "fairly simple".xml file in db with below the part of the code, but for some reason any that it does not work :(

    No idea what I am doing wrong?

    XML file:
    <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
    <BulkExportRootElement xmlns:ns2="http://homeoffice.gov.uk/ immigration/migrant/cas/bulk-cas-common-200903" xmlns="http://homeoffice.gov.uk/ immigration/migrant/cas/bulk-cas-export-200903">
      <ExportFileHeader>
        <BulkExportId>152eec86-d151-4fea-affd-e93ab1d05173</BulkExportId>
        <ReportConstructionDate>2009-09-16</ReportConstructionDate>
      </ExportFileHeader>
      <CASExportData>
        <CASNumber>E4G3AA1A09W0A4</CASNumber>
        <CASStatus>ASSIGNED</CASStatus>
        <LastStatusChanged>2009-09-16</LastStatusChanged>
        <ApplicantId>1010101</ApplicantId>
        <FamilyName>Smith</FamilyName>
        <GivenName>John</GivenName>
        <Nationality>AUS</Nationality>
        <DateOfBirth>
          <ns2:FullDate>1980-02-20</ns2:FullDate>
        </DateOfBirth>
        <PassportTravelDocumentNumber>703121021</PassportTravelDocumentNumber>
        <CourseId>13031</CourseId>
        <CourseCurriculumTitle>Iron Age History</CourseCurriculumTitle>
        <CourseStartDate>2010-01-08</CourseStartDate>
        <ExpectedCourseEndDate>2010-02-13</ExpectedCourseEndDate>
      </CASExportData>
      <CASExportData>
        <CASNumber>E4G3AA1A09V0A7</CASNumber>
        <CASStatus>USED</CASStatus>
        <LastStatusChanged>2009-09-16</LastStatusChanged>
        <ApplicantId>1010102</ApplicantId>
        <FamilyName>March</FamilyName>
        <GivenName>Wi</GivenName>
        <Nationality>AUS</Nationality>
        <DateOfBirth>
          <ns2:FullDate>1983-06-25</ns2:FullDate>
        </DateOfBirth>
        <PassportTravelDocumentNumber>PQ254689</PassportTravelDocumentNumber>
        <CourseId>13031</CourseId>
        <CourseCurriculumTitle>Iron Age History</CourseCurriculumTitle>
        <CourseStartDate>2010-01-08</CourseStartDate>
        <ExpectedCourseEndDate>2010-02-13</ExpectedCourseEndDate>
      </CASExportData>
    </BulkExportRootElement>
    my code:
    declare
        p_aplus_ukba_xml_id number := 671601494;
        l_message clob;
    
        l_xmldoc  clob;
        l_xml  xmltype;
    
        e_cannot_parse exception;
      begin
        select xml
          into l_xmldoc  -- a CLOB, where xml file is stored
        from APLUS_UKBA_XML
        where object_id = p_aplus_ukba_xml_id;
        
        
        l_xml  := xmltype.createxml(l_xmldoc);
        
        dbms_output.put_line('START HEADER');
        
        if xmltype.existsnode(l_xml, 'BulkExportRootElement/ExportFileHeader') = 1 then
          dbms_output.put_line('BulkExportRootElement/ExportFileHeader exists');
          dbms_output.put_line( xmltype.extract(l_xml,'BulkExportRootElement/ExportFileHeader/BulkExportId/text()').getstringval()  );
        else
          dbms_output.put_line('BulkExportRootElement/ExportFileHeader NOT exists!');  
        end if;
        
        -- END;
        update APLUS_UKBA_XML
           set job_id = null, 
               timestamp = sysdate,
               status = 'PROCESSED'
         where object_id = p_aplus_ukba_xml_id;
         
      exception
        when e_cannot_parse then
          l_message := 'ap_ukba_upload.process_xml.e_cannot_parse'||CHR(10)||sqlerrm;
          
          update APLUS_UKBA_XML
          set status     = 'ERROR',
              error_desc = l_message,
              job_id     = null,
              timestamp  = sysdate
          where object_id = p_aplus_ukba_xml_id;
          commit;
          raise_application_error(-20333, 'Cannot parse export file');
        when others then
          l_message := sqlerrm;
         update APLUS_UKBA_XML
          set status     = 'ERROR',
              error_desc = l_message,
              job_id     = null,
              timestamp  = sysdate
          where object_id = p_aplus_ukba_xml_id;
          commit;
          raise;
      end;
    OUTPUT:
    START HEADER
    BulkExportRootElement/ExportFileHeader NOT exists!
    As you can see, output says that there is no such thing as "BulkExportRootElement/ExportFileHeader", but based on the XML file, there are.

    Please advise, as I don't see where is the problem.

    Kind regards
    Tomas

    (I used a similar approach in the various projects and no problem)

    you will have something to hope for... ;)
    Try this pending

    with test as
    (select xmltype (
    '
    
      
        152eec86-d151-4fea-affd-e93ab1d05173
        2009-09-16
      
      
        E4G3AA1A09W0A4
        ASSIGNED
        2009-09-16
        1010101
        Smith
        John
        AUS
        
          1980-02-20
        
        703121021
        13031
        Iron Age History
        2010-01-08
        2010-02-13
      
      
        E4G3AA1A09V0A7
        USED
        2009-09-16
        1010102
        March
        Wi
        AUS
        
          1983-06-25
        
        PQ254689
        13031
        Iron Age History
        2010-01-08
        2010-02-13
      
    ') xmlmsg from dual
    )
    select extract (xmlmsg
                   ,'/BulkExportRootElement/ExportFileHeader/BulkExportId/text()'
                   ,'xmlns:ns2="http://homeoffice.gov.uk/immigration/migrant/cas/bulk-cas-common-200903" xmlns="http://homeoffice.gov.uk/immigration/migrant/cas/bulk-cas-export-200903"'
                   ).getStringVal()
      from test
    
  • Problem with table with XMLTYPE column extractvalue.

    I don't know there is a simple answer, but I have problems
    extract data from a column of xmltype type.
    I have two tables
    descr dab_xml
    Name
    -----------------------------------------------------
    XMLTYPE TABLE
    descr dab_test
    Name
    -----------------------------------------------------
    A NUMBER
    NUMBER OF AB
    CLOB DATA
    DATA2 VARCHAR2 (1600)
    MYXML XMLTYPE

    I inserted the Oracle XML purchaseOrder.xml example in the two dab_xml
    and the myxml in dab_test column.

    When I run the following:

    SELECT extractvalue (OBJECT_VALUE, ' / PurchaseOrder/reference "")
    OF dab_xml;

    SBELL-2002100912333601PDT returned

    When I run the present:

    SELECT extractvalue (OBJECT_VALUE, ' / PurchaseOrder/reference "")
    FROM (select dab_test myxml);

    ERROR on line 1:
    ORA-00904: "OBJECT_VALUE": invalid identifier

    Why are the two different?

    Any help will be appreciated.

    Kind regards

    David

    In short, you want to

    SELECT extractvalue(myxml, '/PurchaseOrder/Reference')
    FROM dab_test;
    

    This difference is that for dab_xml, it has no columns defined for the table, so you are [OBJECT_VALUE | http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/pseudocolumns006.htm#sthref830] as an alias for a column does not exist.

    With dab_test, you have a column that contains the XML, you must use this column instead of OBJECT_VALUE name.

  • Problem in the select statement on the xmltype table

    Hello

    I have a table xmltype with a type of object/atrribute to the CLOB data type. When I now do a query, I get the error ORA-22835 - what goes wrong? The data type of the attribute of the source and the declared variable is CLOB.
    DECLARE
      vFoto  CLOB;
    BEGIN
      SELECT SUBSTR(pe.foto_pass, 1, 100) INTO vFoto
        FROM fp_epass_pass_antraege pa
           , XMLTABLE('/PassAntrag'
             PASSING pa.sys_nc_rowinfo$
             COLUMNS antrag     XMLTYPE PATH '/PassAntrag/Antrag'
                   , person     XMLTYPE PATH '/PassAntrag/Person') paan
           , XMLTABLE('/'
             PASSING paan.antrag
             COLUMNS uuid       VARCHAR2(38) PATH 'UUID') an
           , XMLTABLE('/'
             PASSING paan.person
             COLUMNS foto_pass  CLOB PATH 'FotoPass') pe
             WHERE an.uuid = '84239536904120131828493266953553299522';
    END;
    Thanks in advance.

    Kind regards
    Martin

    Martin1 wrote:
    But now I have to decode the base64binary data.

    The BLOB that results already contains the decoded base64 data.

    Now, given your sample, it seems the decoded content (or at least a part of it) contains data base64 again. Is this right?

  • 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

  • Problem with extracted xmltype and namespace

    I have this code
    SET SERVEROUTPUT ON
    DECLARE
      
      id_error VARCHAR2(4000);
    
      docResp varchar2(32767);
      resp sys.xmltype:= null;
      docClob CLOB;
      docDom xmldom.DOMDocument;
      in_xml sys.xmltype;
    
      lista xmldom.DOMNodeList;
      nodo  xmldom.DOMNode;
    
      totmp varchar2(4000);
      texto varchar2(4000);
    
    
      -- Parse ------------------------------------------------------------------
      FUNCTION Parse( xml_clob CLOB ) RETURN xmldom.DOMDocument IS
        retDoc    xmldom.DOMDocument;
        parseador xmlparser.parser;
      BEGIN
        parseador := xmlparser.newParser;
        xmlparser.parseClob( parseador, xml_clob );
        retDoc := xmlParser.getDocument( parseador );
        xmlparser.freeParser( parseador );
        RETURN retDoc;
      END Parse;
    
    BEGIN
    dbms_Output.enable(10000);
      docResp := 
        '<SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/">
        <SOAP-ENV:Body>
            <SOAP-ENV:Fault>
                <faultcode>A</faultcode>
                <faultstring>B</faultstring>
                <detail>
                    <siebelf:errorstack xmlns:siebelf = "http://www.siebel.com/ws/fault">
                        <siebelf:error>
                            <siebelf:errorsymbol>E</siebelf:errorsymbol>
                            <siebelf:errormsg>C</siebelf:errormsg>
                        </siebelf:error>
                    </siebelf:errorstack>
                </detail>
            </SOAP-ENV:Fault>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>';
    
      in_xml := sys.xmltype.createxml(docResp);
      resp := xmltype.createxml(docResp);
      docClob := resp.getClobVal();
      docDom := Parse(docClob);
    
    
      -- Recupero la lista de nodos
      lista := xmldom.getElementsByTagName( docDom, 'errorsymbol' );
      nodo := ( xmldom.item( lista, 0 ) );
    
      xmldom.writeToBuffer(nodo, totmp);
      dbms_Output.put_line('VALUE: '||totmp);
      texto :=
      sys.xmltype.
      createxml(totmp).extract('//text()').getStringVal();
      dbms_Output.put_line('FINAL: '||texto);
    END;
    /
    If try run in Oracle9i Enterprise Edition Release 9.2.0.6.0, result:
    VALUE: <siebelf:errorsymbol xmlns:siebelf="http://www.siebel.com/ws/fault">E</siebelf:errorsymbol>
    FINAL: E
    If try in Oracle Database 10g Enterprise Edition Release 10.2.0.4.0, result
    VALUE: <siebelf:errorsymbol>E</siebelf:errorsymbol>
    DECLARE
    *
    ERROR en línea 1:
    ORA-31011: fallo en el análisis de XML
    ORA-19202: Se ha producido un error en el procesamiento
    LPX-00234: el prefijo de espacio de nombres "siebelf" no se ha declarado
    Error at line 1
    de XML
    ORA-06512: en "SYS.XMLTYPE", línea 60
    ORA-06512: en línea 62
    Why?

    Published by: jortri on June 25, 2010 11:37

    The differences are due to the fact that Oracle 10 g went in accordance with W3C.
    If the XMLType constructor complains about a missing namespace declaration, which is XML not valid according to the W3C.

    That being said, you can greatly simplify the code:

    DECLARE
    
      docResp varchar2(32767);
      resp    xmltype;
      error   xmltype;
    
    BEGIN
    
      docResp :=
        '
        
            
                A
                B
                
                    
                        
                            E
                            C
                        
                    
                
            
        
    ';
    
      resp := xmltype(docResp);
      error := resp.extract('//siebelf:errorsymbol', 'xmlns:siebelf="http://www.siebel.com/ws/fault"');
    
      dbms_output.put_line('VALUE: '||error.getStringVal());
      dbms_output.put_line('VALUE: '||error.extract('//text()').getStringVal());
    
    END;
    
  • problems with selection of XMLType column value

    I want to extract my XMLType column values. Can someone tell me why this works
    select XMLCAST
              (
                XMLQUERY
                (
                   'declare default element namespace  "urn:hl7-org:v3"; (: :)
                    declare namespace voc = "urn:hl7-org:v3/voc"; (: :)
                    $doc/ClinicalDocument/recordTarget/patientRole/patient/name/family'
                    passing CCD_DOC as "doc"
                    returning content
                )
                as VARCHAR2(4000)
              )
         from CCD
    but it does not work?
    select
        ccdid,
        extractvalue(CCD_DOC,'/recordTarget/patientRole/patient/name/given') "given",
        extractvalue(CCD_DOC,'/recordTarget/patientRole/patient/name/family') "family",
        extractvalue(CCD_DOC,'/recordTarget/patientRole/providerOranization/name') "name",
        extractvalue(CCD_DOC, 'title') as Title
    from CCD
    where ClinicalDocument is the root element?

    I don't get any errors on the other, but the three XML derived columns are null. The values are not retrieved while the values ARE retrieved using the first method.

    Thank you!

    XMLTable...

    select x.*
      from CCD,
           XMLTable
           (
             xmlNamespaces
             (
               default 'urn:hl7-org:v3',
               'urn:hl7-org:v3/voc' as "voc"
             ),
             '$doc/ClinicalDocument/recordTarget/patientRole'
             passing CCD_DOD as "doc"
             columns
             given varchar2(128) path 'patient/name/given',
             family varchar2(128) path 'patient/name/family',
             name varchar2(128) path 'providerOranization/name'
           ) x
    
  • Problem with the collection xmltype column - tags endangered

    Hello

    Apex 4.0, I have a traditional relationship with this query:
    SELECT c.collection_name,
           c.seq_id,
           c.c001,
           c.c002,
           c.xmltype001.getclobval() xmltype001
    FROM   apex_collections c
    The xmltype001 column is set to display text (special escape characters). What I see on the page of this something column is:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
     <env:Header/>
     <env:Body>
     <m:tag1 xmlns:m="http://cosservices/COSServices.wsdl">
     <result xmlns:typ="http://cosservices/COSServices.wsdl/types/">
     <typ:tag2>
     <typ:subdepartmentCode>AUTO</typ:subdepartmentCode>
     <typ:subdepartmentName>Automotive</typ:subdepartmentName>
     <typ:itemNumber>0000610</typ:itemNumber>
    ...
    This column is filled by calling a web service using this package Apex web service utility, and this is the content for this column. However, when I export to CSV, what I see in the text file is the following:
      
      
        
          
            
              
              AUTO
              Automotive
         0000610
    ...
    In case you missed it: all tags have disappeared and that the actual data remained. If I change the type of column to Column Standard in the report, the same thing is happening on the page.

    My findings to date are:
    -Tags are present in the column, as it is sort of the column display in text type is smart enough to display the data correctly.
    -It seems that this has something to do with the character encoding, but I don't know how to fix it. I tried to use the convert() function but no luck.

    Any ideas?

    Thank you
    Luis

    Hi Luis,.

    It is not something as simple that the attribute "Strip HTML" report, is it?
    (ie - change no.)

    Scott

  • How to choose the spelling multilingual document settings and change it on the fly...

    With the help of multilingual documents is a problem - I often need to check spelling in different languages as you type. An indicator in the menu would be a great help...

    Best regards

    As you normally do for applications that use the spellchecker to Apple is going in Edition > spelling and grammar > show spelling and grammar in each app and all of the dictionary that you need for the specific text that you control.

    If you can mark portions of text as being in a specific language depends on the application.  I think that only Apple apps that can do that can be the old Pages 4 and iBooks author.

    Note that some applications (like MS Word) not to use the spellchecker to Apple and have their own internal systems.

    To request a new feature, Apple, go to

    http://www.Apple.com/feedback

  • What is "composition" of key multilingual on iPad?

    Hello

    I got an iPad case comes with a keyboard.  I used it for 2 years, but the plastic case is more let me abuse.  As a result, I bought a new (aka case of clams).  One of the old keyboard that I found pretty convenient was key multilingual.  It has a picture of the globe (I think) and I would like to scroll through the different languages.  Often, I switched from English to traditional Chinese/Japanese, simplified Chinese and back to English.  The problem is that my new case + keyboard has no this key.

    Can anyone tell me please what combination I can use to change the language of the keyboard?  It is command - something or Alt - one another?

    Thanks in advance for your help.

    Tena Sakai

    We control more space.

  • Error code: C000009A (problems applied update registry during the installation of Windows 7 Service Pack 1)

    After installation of Windows 7 Service Pack 1, the system restarts, and before windows comes up the registry is updated.  I get an error C000009A 128115 of 387921 enforcement update (/ registry)... error that prevents the system to reboot.  Is it possible to get the system to reboot and complete the installation of the service pack.  The only way that I was able to work around this error is to restore from the system restore point before the service pack, but I want to apply the SP1 if possible.  ????

    Windows update and SP1 gave me the same problem and I used this hole day to RESOLVE.

    Windows 7 is not bootable. Safe mode Windows 7 was not bootable, - stop at classpnp.sys.  I used the line of command of the rescue disk and Linux (!) to fix it.  And then little important reading / advice on this forum.

    Error message at startup:

    C000009A application update 262832 (registry\ma 109544 operation error   (no more room on screen)

    After a few reboots failed, I tried a restore of windows rescue disk, but windows update has somehow erased all my restore point! (Argh)

    Then I looked in the log file c:\windows\winsxs\poqexec.log and found a reference to the error: (obs this folder has some 70,000 + files)

    1cbd36fd5eb05f3: 74, c000009a, 1abe7, 0, SetKeyValue; \Registry\Machine\Software\Microsoft\Windows\CurrentVersion\SideBySide\Winners\amd64_microsoft-windows-e atibility.resources_31bf3856ad364e35_pt - pt_0b9032dad0ee6ed8\6.1, 6.1.7600.16385, AQ =.

    Then I tried to add this key in the registry using regedit command line after booting from the rescue floppy.  But repeated boots showed this register does not have / save my extra key. (Strange-I should be able to change the shape of the hot spare register, or?)

    Next step was to start a live CD of Linux (Mandriva) to browse the windows system drive.

    This way, I found the c:\windows\winsxs\pending.xml (99 MB) file and may open in kwrite (Linux).  I'm looking for "atibility.resources_31bf3856ad364e35_pt - pt. Found only in the 114.808 (of more than 300,000 lines) line.  Add a! After< to="" make="" this="" xml="" line="" a="" comment.=""  saved="" the="" file.="" rebooted="" and="" ..="" yes="" ..,="" windows="" 7="" updated="" some="" files,="" rebooted="" 2="" times="" and="" then="" started="" as="">

    I guess MS has created a lot of angry people today!

    Amd64_microsoft-windows-e... atibility.resources_... file is probably related to

    (a) ATI/AMD graphics (as in my system) cards

    (b) Windows MUI (Multilingual User Interface) system in windows 7 ultimate.

    PT - pt is a code for a language.  (Not mine, I'm from Norway, no.)

    on Windows 7 ultimate (new)

Maybe you are looking for

  • Error Msg received on the tab open: Exc in ev handl: error: Bad NPObject as private data!

    Very simple - the following error message appears when I open a new tab with a web page or empty:EXC in ev handl: error: Bad NPObject as private data!

  • Strange problem with password created on my Satellite L20

    I bought a Toshiba Satellite L20 laptop with model No. PSL2XL-01R007I registered the password using the Toshiba help utility that has been placed on the desktop, using the secure user function. After stop of the laptop and turned on, it prompted me t

  • Where to download the server for h340′s recovery CD?

    I have been using Acer Aspire easyStore 340 store all the videos of our family pictures and many other files. It works very well for a few years. A week before, without warning, it has stopped working. Troubleshooting, I realized that the hard drive

  • Laser jet 1018 HP printer does not

    Original title: Laser jet 1018 HP printer does not I have a Laser jet HP 1018 and lost the disc printer if I can get any computer to be able to communicate with him. I downloaded the software that I thought I was able to run the printer, but nothing

  • IPS failover reload

    I was told in another topic, that retrieve the SSM IPS by the image of the upgrade/reload would cause the firewall for failover. The upgrade of the "failover" device will cause his failure in primary?