How to read data with different XML schemas within the single connection?

I have Oracle 11g database
I access it through jdbc:oracle:thin, version 11.2.0.3, same as xdb.
I have several tables, each has one XMLType column, all schema-based.
There are three different XML schemata registered in the DB
I may need to read the XML data from several tables.
If all the XMLTypes have the same XML schema ,there is no problem,
If the schemata are different, the second read throws BindXMLException.
If I reset the connection between the reads of the XMLType column with different schemata, it works.
The question is: how can I configure the driver, or the connection to be able to read the data with different XML schemata without resetting the connection (which is expensive).
The code to get the XMLType data is textbook implementation:
1   ResultSet resultSet = statement.executeQuery( sql ) ;
2   String result = null ;
3    while(resultSet.next()) {
4   SQLXML sqlxml = resultSet.getSQLXML(1) ;
5   result = sqlxml.getString() ;
6   sqlxml.free();
7   }
8   resultSet.close();
9    return result ;

It turns out, that I needed to serialize the XML on the server and read it as Blob. Like this:
1    final Statement statement = connection.createStatement() ;
2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;
3   ResultSet resultSet = statement.executeQuery( sql ) ;
4   String result = null ;
5    while(resultSet.next()) {
6   Blob blob = resultSet.getBlob( 1 );
7   InputStream inputStream = blob.getBinaryStream();
8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();
9   inputStream.close();
10   blob.free();
11   }
12   resultSet.close();
13   statement.close();
14
15   System.out.println( result );
16    return result ;
17
Then it works. Still, can't get it work with XMLType in resultset.On the client unwrapping XML blows up when trying to switch to different XML schema. JDBC/XDB problem?

Similar Messages

  • Is it possible to use List Type in XML schema within the SOA Rule author?

    Is it possible to use List Type in XML schema within the SOA Suite Rule author? The reason is that with the following XSD, Rule author generates XML facts of type "List" for the element "ResultSet". Basically I want to check the Input facts (Input1, Input2, Input3) for some conditions and then assign action to the element Resultset of type List (array). The output Resultset can contain multiple values based on the input facts. My problem is that I am unable to see the ResultSet in the "Assign" action type of the action block. Is it possible to use the Resultset of type List with the Rule author or is there any limitation on the rule author and any workaround for this?
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oracle.com/ns/TestMultipleOutputs"
    elementFormDefault="qualified">
    <element name="TestMultipleOutputs">
    <complexType>
    <sequence minOccurs="0">
    <element name="Input1" type="string" minOccurs="0"/>
    <element name="Input2" type="string" minOccurs="0"/>
    <element name="Input3" type="string" minOccurs="0"/>
    <element name="ResultSet" type="string" minOccurs="0"
    maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    --Thanks a lot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Richard,
    I have slightly modified the xml schema you suggested and was able to import into the rule author. the following is the modified XSD. Rule Author created a List type for the "ResultSet" . I still don't see "Resultset" in the assign action, so I tried creating RL function in order to assign the output to the "Resultset", but was unsuccessful so far. can you please let me know how to populate the resultset with the output values? Thanks a lot.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema attributeFormDefault="unqualified"
    xmlns:ns1="http://www.oracle.com/ns/TestComplexOutputs"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oracle.com/ns/TestComplexOutputs"
    xmlns:tns="http://www.oracle.com/ns/TestComplexOutputs"
    elementFormDefault="qualified">
    <xsd:element name="TestComplexOutputs">
    <xsd:complexType>
    <xsd:sequence minOccurs="0">
    <xsd:element name="Input1" type="xsd:string" minOccurs="0"/>
    <xsd:element name="Input2" type="xsd:string" minOccurs="0"/>
    <xsd:element name="Input3" type="xsd:string" minOccurs="0"/>
    <xsd:element name="ResultSet" type="tns:ResultSetType" minOccurs="0"
    maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:complexType name="ResultSetType">
    <xsd:sequence>
    <xsd:element name="ResultSet" type="tns:ResultSetStructure" minOccurs="1"
    maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ResultSetStructure">
    <xsd:sequence>
    <xsd:element name="ErrorReason">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>

  • How to read data with BDC

    In order to search notification, I recorded a script with SHBD . This script go to IW28 and do a simple search. It works but I want to have the result to do another treatment.
    Is it possible to have the data showed in a list?
    This is my script :
    FUNCTION z_pm_web_liste_avis.
    *"*"Interface locale :
    *"  EXPORTING
    *"     REFERENCE(AVIS) TYPE  ZPM_AVIS
       PERFORM bdc_dynpro      USING 'RIQMEL20' '1000'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'SELSCHEM'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=ONLI'.
       PERFORM bdc_field       USING 'DY_OFN'
                                     'X'.
       PERFORM bdc_field       USING 'DY_IAR'
                                     'X'.
       PERFORM bdc_field       USING 'DATUV'
                                     '14.03.2014'.
       PERFORM bdc_field       USING 'DATUB'
                                     '12.06.2014'.
       PERFORM bdc_field       USING 'MZEIT-LOW'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'MZEIT-HIGH'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'AUZTV-LOW'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'AUZTV-HIGH'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'AUZTB-LOW'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'AUZTB-HIGH'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'VARIANT'
                                     '/AAI_PM_REL'.
       PERFORM bdc_dynpro      USING 'SAPMSSY0' '0120'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     '04/03'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=BACK'.
       PERFORM bdc_dynpro      USING 'RIQMEL20' '1000'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '/EE'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'SELSCHEM'.
       PERFORM bdc_transaction USING 'IW28'.
       COMMIT WORK.
    ENDFUNCTION.
    *&      Form  bdc_dynpro
    *       text
    *      -->PROGRAM    text
    *      -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
       DATA gs_bdcdata TYPE bdcdata.
       CLEAR gs_bdcdata.
       gs_bdcdata-program  = program.
       gs_bdcdata-dynpro   = dynpro.
       gs_bdcdata-dynbegin = 'X'.
       APPEND gs_bdcdata TO gt_bdcdata.
    ENDFORM.                    "BDC_DYNPRO
    *&      Form  bdc_field
    *       text
    *      -->FNAM       text
    *      -->FVAL       text
    FORM bdc_field USING fnam fval.
       DATA gs_bdcdata TYPE bdcdata.
       CLEAR gs_bdcdata.
       gs_bdcdata-fnam  = fnam.
       gs_bdcdata-fval  = fval.
       APPEND gs_bdcdata TO gt_bdcdata.
    ENDFORM.                    "BDC_FIELD
    *&      Form  bdc_transaction
    *       text
    *      -->TCODE      text
    FORM bdc_transaction USING tcode.
       DATA: messtab TYPE TABLE OF bdcmsgcoll WITH HEADER LINE.
       DATA: l_mstring(480).
       DATA: l_subrc LIKE sy-subrc.
       REFRESH messtab.
       CALL TRANSACTION tcode USING gt_bdcdata
                        MODE   'A'
                        UPDATE 'S'
                        MESSAGES INTO messtab.
       l_subrc = sy-subrc.
       WRITE: / 'CALL_TRANSACTION',
                tcode,
                'returncode:'(i05),
                l_subrc,
                'RECORD:',
                sy-index.
       LOOP AT messtab.
         MESSAGE ID     messtab-msgid
                 TYPE   messtab-msgtyp
                 NUMBER messtab-msgnr
                 INTO l_mstring
                 WITH messtab-msgv1
                      messtab-msgv2
                      messtab-msgv3
                      messtab-msgv4.
         WRITE: / messtab-msgtyp, l_mstring(250).
       ENDLOOP.
       SKIP.
       REFRESH gt_bdcdata.
    ENDFORM.                    "BDC_TRANSACTION

    It turns out, that I needed to serialize the XML on the server and read it as Blob. Like this:
    1    final Statement statement = connection.createStatement() ;
    2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;
    3   ResultSet resultSet = statement.executeQuery( sql ) ;
    4   String result = null ;
    5    while(resultSet.next()) {
    6   Blob blob = resultSet.getBlob( 1 );
    7   InputStream inputStream = blob.getBinaryStream();
    8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();
    9   inputStream.close();
    10   blob.free();
    11   }
    12   resultSet.close();
    13   statement.close();
    14
    15   System.out.println( result );
    16    return result ;
    17
    Then it works. Still, can't get it work with XMLType in resultset.On the client unwrapping XML blows up when trying to switch to different XML schema. JDBC/XDB problem?

  • How to Read data from a xml?

    Dear All,
    My Xml file has the following attributes,
    <UserLogSettings>
    <LogLaserActions>False</LogLaserActions>
    <LogAlways>True</LogAlways>
    <Current>True</Current>
    <Frequency>True</Frequency>
    <Shg>True</Shg>
    <Thg>True</Thg>
    <Temperature>True</Temperature>
    <LogFromDate>1/01/0001 12:00:00 AM</LogFromDate>
    <LogToDate>1/01/0001 12:00:00 AM</LogToDate>
    <ErrorLoggerSize>2</ErrorLoggerSize>
    <Seed>True</Seed>
     </UserLogSettings> 
    I want to read the above xml file and display each attribute separately, How can I do this?
    Gaya 

    Hi Gaya,
    you could read the text file and parse for the different XML tags. This has been asked before so you should find thread discussing the parsing part...
    Or you could dig into OpenG, they provide some powerful XML functions too...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to "join" data from different SyncBO's within MAM?

    Hi,
    Have anyone tried "joining" the data from different SyncBO's into one in a custom MAM application?  For example, the SyncBO MAM30_30 (Functional Location) has references to MAM30_016 (Catalog + Code Groups).  Is there an easy way to display all of the related information together, instead of first looping through objects from MAM30_030, then for each individual object, loop through a list of MAM30_016? 
    Basically, the application that we're working with has 3000+ Functional Locations, so we are looking for a way to join the data and display them as one object to improve performance.
    Many thanks!
    Jeffrey

    Thanks Norbert.  Unfortunately, we cannot create new Syncbo's, as we have limited access to that R/3 backend.
    Basically, what we want to do is customize the MAM bit so that it can display the Tech Obj List with all its codes and children item syncbo's, instead of having the user click on the link to see more info.  We would like to do this without having to loop through the child sync bo's.
    Many thanks!

  • How to read data from different tabs of an excel sheet?

    Hello everybody:
    I try to read an specific sheet from excel workbook with multiple sheets, but I can't obtain any soluction. Any have a example ABAP code for the specific question?
    Regards,
    Piero Cimule Troise,

    Piero,
    Have a look into this link
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci868246,00.html?FromTaxonomy=/pr/283958

  • Specifying nested element with two different XML Schema

    Hello,
    I am trying to convert one xml file to another file. I figure data services would be great for this.
    My problem relates to how to have a source xml file with a certain xml schema be transformed to one of a different xml schema. I cannot build the nested elements of the target schema.
    From the source xml I only need four fields. But they need to be nested three levels in the target xml.
    Source
    <DRUG_PRODUCT_LST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <DRUG_ITEM>
          <DRUG_PRODUCT_ID>113083</DRUG_PRODUCT_ID>
          <DIN_PDIN>2317559</DIN_PDIN>
          <HC_BRAND_NAME>PMS-SILDENAFIL</HC_BRAND_NAME>
          <HC_ATC_CODE>G04BE03</HC_ATC_CODE>
       </DRUG_ITEM>
    <DRUG_PRODUCT_LST
    Target
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <CODES>
       <CODE_TYPES>
          <CODE_TYPE>
             <COD_CODE>113083</COD_CODE>
             <COD_DESCR>PMS-SILDENAFIL</COD_DESCR>
             <COD_SOURCE>G04BE03</COD_SOURCE>
             <COD_NPSA>2317559</COD_NPSA>
          </CODE_TYPE>
       </CODE_TYPES>
    </CODES>
    I have tried using an xml pipline to unnest the source, then use a query transform to re-nest for the target. But I do not know how to specify the input schemas.

    Hello,
    I am trying to convert one xml file to another file. I figure data services would be great for this.
    My problem relates to how to have a source xml file with a certain xml schema be transformed to one of a different xml schema. I cannot build the nested elements of the target schema.
    From the source xml I only need four fields. But they need to be nested three levels in the target xml.
    Source
    <DRUG_PRODUCT_LST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <DRUG_ITEM>
          <DRUG_PRODUCT_ID>113083</DRUG_PRODUCT_ID>
          <DIN_PDIN>2317559</DIN_PDIN>
          <HC_BRAND_NAME>PMS-SILDENAFIL</HC_BRAND_NAME>
          <HC_ATC_CODE>G04BE03</HC_ATC_CODE>
       </DRUG_ITEM>
    <DRUG_PRODUCT_LST
    Target
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <CODES>
       <CODE_TYPES>
          <CODE_TYPE>
             <COD_CODE>113083</COD_CODE>
             <COD_DESCR>PMS-SILDENAFIL</COD_DESCR>
             <COD_SOURCE>G04BE03</COD_SOURCE>
             <COD_NPSA>2317559</COD_NPSA>
          </CODE_TYPE>
       </CODE_TYPES>
    </CODES>
    I have tried using an xml pipline to unnest the source, then use a query transform to re-nest for the target. But I do not know how to specify the input schemas.

  • How do partition a hard drive with different partition schemes?

    How can you partition an external HD with different partition schemes for different partitions? GUID one one partition and Apple Partition Map on another?
    Thanks.

    I am trying to add a second partition to my (1TB) external firewire HD. Apparently it was preformatted as "MS-DOS (FAT)" and I started putting lots of files on there. Now the "partition" option in disk utility shows me the one partition that's on there, but all options are grayed-out - I cannot add another partition, it seems, nor change anything on the existing one. Is there any possible solution other than totally erasing the disk and starting from scratch? I would be hard-pressed to find enough disk space to (even temporarily) store the stuff that's already on that HD.

  • How to create default column in XML schema ?

    Hi All,
    I would like to define a default column let's say Run_Date as Date datatype in XML schema definition (XSD) and would like to populate SYSDATE to the column Run_Date, When XML records are parsed to that schema.
    Please let me know, how we can achieve?
    Thanks in Advance.

    Hi,
    Thanks for the update. Please find below my responses and let me know your thoughts.
    The Existing schema definition is as follows
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="Emp" type="EmpType" xdb:defaultTable="EMPLOYEES" xdb:columnProps="CONSTRAINT emp_pk PRIMARY KEY (XMLDATA.EMP_NO)" />
    <xs:complexType name="EmpType" xdb:SQLType="EMPLOYEES_T">
    <xs:sequence>
    <xs:element name="EmpNo" xdb:SQLName="EMP_NO">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="FirstName" xdb:SQLName="FIRST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="LastName" xdb:SQLName="LAST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmployeeType" xdb:SQLName="EMPLOYEE_TYPE">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="25"/>
    <xs:enumeration value="Permanent"/>     
    <xs:enumeration value="Consultant"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpLocation" xdb:SQLName="EMP_LOCATION">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="25"/>
    <xs:enumeration value="NewYork"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpExperience" xdb:SQLName="EMP_EXPERIENCE">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    The sample XML file is as follows
    <?xml version="1.0"?>
    <Emp xsi:noNamespaceSchemaLocation="EMP.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb="http://xmlns.oracle.com/xdb">
    <EmpNo>1001</EmpNo>
    <FirstName>William</FirstName>
    <LastName>Don</LastName>
    <EmployeeType>Permanent</EmployeeType>
    <EmpLocation>NewYork</EmpLocation>
    <EmpExperience>10</EmpExperience>
    </Emp>
    The modified schema definition is as follows
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="Emp" type="EmpType" xdb:defaultTable="EMPLOYEES" xdb:columnProps="CONSTRAINT emp_pk PRIMARY KEY (XMLDATA.EMP_NO)" />
    <xs:complexType name="EmpType" xdb:SQLType="EMPLOYEES_T">
    <xs:sequence>
    <xs:element name="EmpNo" xdb:SQLName="EMP_NO">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="FirstName" xdb:SQLName="FIRST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="LastName" xdb:SQLName="LAST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmployeeType" xdb:SQLName="EMPLOYEE_TYPE">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="25"/>
    <xs:enumeration value="Permanent"/>     
    <xs:enumeration value="Consultant"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpLocation" xdb:SQLName="EMP_LOCATION">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="25"/>
    <xs:enumeration value="NewYork"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpExperience" xdb:SQLName="EMP_EXPERIENCE">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="WorkHrs" maxOccurs="100" xdb:SQLName="WorkHrs" xdb:propNumber="3280" xdb:global="false" xdb:SQLType="WorkHrs_T" xdb:SQLSchema="APPS" xdb:memType="258" xdb:SQLInline="true" xdb:MemInline="false" xdb:JavaInline="false" xdb:SQLCollType="WORKHRS330_COLL" xdb:SQLCollSchema="APPS">
    <xs:complexType xdb:SQLType="WORKHRS_T" xdb:SQLSchema="APPS">
    <xs:attribute name="Day" xdb:SQLName="DAY" xdb:propNumber="3273" xdb:global="false" xdb:SQLType="VARCHAR2" xdb:memType="2">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="Hrs" xdb:SQLName="HRS" xdb:propNumber="3274" xdb:global="false" xdb:SQLType="NUMBER" xdb:memType="2">
    <xs:simpleType>
    <xs:restriction base="xs:decimal"/>
    </xs:simpleType>
    </xs:attribute>
    </xs:schema>
    The sample XML file is as follows
    <?xml version="1.0"?>
    <Emp xsi:noNamespaceSchemaLocation="EMP.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb="http://xmlns.oracle.com/xdb">
    <EmpNo>1001</EmpNo>
    <FirstName>William</FirstName>
    <LastName>Don</LastName>
    <EmployeeType>Permanent</EmployeeType>
    <EmpLocation>NewYork</EmpLocation>
    <EmpExperience>10</EmpExperience>
    <WorkHrs Day="Monday" Hrs="8.0"/>
    <WorkHrs Day="Tuesday" Hrs="6.5"/>
    <WorkHrs Day="Wednesday" Hrs="8.5"/>
    <WorkHrs Day="Thursday" Hrs="10.5"/>
    <WorkHrs Day="Friday" Hrs="5.5"/>
    </Emp>
    The Copy Evolve Procedure is as follows (I have added attributes to the above schema definition)
    DECLARE
    SCHEMA_TO_EVOLVE     XDB$STRING_LIST_T;
    NEW_SCHEMA               XMLSEQUENCETYPE;
    OLD_SCHEMA_URL          VARCHAR2(100) := 'EMP.xsd';
    V_NEW_XML_DOC          CLOB := '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="Emp" type="EmpType" xdb:defaultTable="EMPLOYEES" xdb:columnProps="CONSTRAINT emp_pk PRIMARY KEY (XMLDATA.EMP_NO)" />
    <xs:complexType name="EmpType" xdb:SQLType="EMPLOYEES_T">
    <xs:sequence>
    <xs:element name="EmpNo" xdb:SQLName="EMP_NO">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="FirstName" xdb:SQLName="FIRST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="LastName" xdb:SQLName="LAST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmployeeType" xdb:SQLName="EMPLOYEE_TYPE">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="25"/>
    <xs:enumeration value="Permanent"/>     
    <xs:enumeration value="Consultant"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpLocation" xdb:SQLName="EMP_LOCATION">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="25"/>
    <xs:enumeration value="NewYork"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpExperience" xdb:SQLName="EMP_EXPERIENCE">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="WorkHrs" maxOccurs="100" xdb:SQLName="WorkHrs" xdb:propNumber="3280" xdb:global="false" xdb:SQLType="WorkHrs_T" xdb:SQLSchema="APPS" xdb:memType="258" xdb:SQLInline="true" xdb:MemInline="false" xdb:JavaInline="false" xdb:SQLCollType="WORKHRS330_COLL" xdb:SQLCollSchema="APPS">
    <xs:complexType xdb:SQLType="WORKHRS_T" xdb:SQLSchema="APPS">
    <xs:attribute name="Day" xdb:SQLName="DAY" xdb:propNumber="3273" xdb:global="false" xdb:SQLType="VARCHAR2" xdb:memType="2">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="Hrs" xdb:SQLName="HRS" xdb:propNumber="3274" xdb:global="false" xdb:SQLType="NUMBER" xdb:memType="2">
    <xs:simpleType>
    <xs:restriction base="xs:decimal"/>
    </xs:simpleType>
    </xs:attribute>
    </xs:schema>';
    BEGIN
    DBMS_OUTPUT.PUT_LINE('B4 GETTING FILE FROM OS');
    EXECUTE IMMEDIATE 'DROP TABLE EMPLOYEES_TEMP';
    -- Getting file from the file system
    --V_NEW_XML_DOC           := XXTIF_EDI_UTL.GET_CLOB_DOCUMENT('COIL_1.1.xsd','UTF8');
    SCHEMA_TO_EVOLVE     := XDB$STRING_LIST_T(OLD_SCHEMA_URL);
    NEW_SCHEMA           := XMLSEQUENCETYPE(XMLTYPE(V_NEW_XML_DOC));
    DBMS_XMLSCHEMA.COPYEVOLVE(SCHEMA_TO_EVOLVE,NEW_SCHEMA, preserveOldDocs => TRUE, mapTabName => 'EMPLOYEES_TEMP', generateTables => FALSE);
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('SUCCESSFULLY COPIED');
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('THE ERROR IS '||SQLERRM);
    END;
    The Table Creation is as follows
    CREATE TABLE EMPLOYEES (XMLDOC XMLTYPE,
                   CREATE_DATE DATE DEFAULT SYSDATE NOT NULL ,
    CONSTRAINT emp_pk PRIMARY KEY (XMLDOC."XMLDATA".EMP_NO)
    XMLTYPE COLUMN XMLDOC STORE AS OBJECT RELATIONAL
    XMLSCHEMA "EMP.xsd" ELEMENT "Emp"
    DECLARE
    TABLENAME VARCHAR2(2000) := 'EMPLOYEES1128';
    BEGIN
    SELECT TEMP_TABNAME
    INTO TABLENAME
    FROM EMPLOYEES_TEMP
    WHERE TABLE_NAME = USER || '.' || UPPER('RELATIE_DOCUMENTEN');
    EXECUTE IMMEDIATE 'INSERT INTO EMPLOYEES(XMLDOC) SELECT XMLTYPE(DATA) FROM ' || TABLENAME;
    COMMIT;
    END;
    When I executed the above SQL, It only populates main data(Perosnal Details such as EmpNo,FirstName,LastName) but not attributes (Workhrs.Day,WOrkhrs.Hrs).
    Please let me know, how can I move those attributes data?
    Again Oracle & XML versions are as follows
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    Oracle XML Database 10.2.0.3.0
    Thanks in Advance.

  • How to get  data with the raw pattern from resultset ?

    would you tell me how to get data with the raw pattern from resultset ?
    thank you in advance!
    longgger2000

    I tried getBytes() and getObject()
    , but I can not get the right result , for example the
    data in oracle database is 01000000DFFF, when In used
    the method of getBytes() and getObject(), I get the
    result of [B@1c2e8a4, very different , please tell me
    why !
    thank you
    longgger2000
    [B is byte arrayseem that it return an bytes array for you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Refer to different XML schema

    When I save file as "Word XML document", what kinds of schema does MS word using? Is it possible to use another XML schema? If so, how?
    Plus, is it possible to use VBA inside MS word so that I can create save as "Word XML document" inside the "Save as type option"? 

    ​Hi UW,
    >> When I save file as "Word XML document", what kinds of schema does MS word using?
    Word uses its own XML schema.
    >> Is it possible to use another XML schema? If so, how?
    Yes, you could use your custom XML schema. The link below shows more details:
    # What You Can Do with Word XML [Word 2003 XML Reference] --  Microsoft Office Word 2003 XML Software Development Kit
    https://msdn.microsoft.com/en-us/library/office/aa223584(v=office.11).aspx
    For how to use another XML schema, you could refer the link below:
    # Create a rich Word document based on your own custom XML (without the need for XSLT)
    http://blogs.msdn.com/b/brian_jones/archive/2006/01/09/customxml1.aspx
    >> is it possible to use VBA inside MS word so that I can create save as "Word XML document" inside the "Save as type option"?
    What do you mean by "create save as "Word XML document" inside the "Save as type option"?"? Do you mean you want to create a new option in the Save as type option? In my option, you could not. The FileFormat in the Document
    was specified by WdSaveFormat Enumeration. You could not modify the WdSaveFormat Enumeration. You could refer the link below:
    # WdSaveFormat Enumeration (Word)
    https://msdn.microsoft.com/en-us/library/office/ff839952.aspx
    In addition, if you have any issue about using another XML schema, I will recommend you post a new thread.
    The reason why I suggested is:
    #1 There would be more community members to discuss the question.
    #2 For people who have the similar question, it would be easier for them to find the answer from a specific thread.
    Best Reards,
    Edwrad
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Open Hub: How-to doc "How to Extract data with Open Hub to a Logical File"

    Hi all,
    We are using open hub to download transaction files from infocubes to application server, and would like to have filename which is dynamic based period and year, i.e. period and year of the transaction data to be downloaded. 
    I understand we could use logical file for this purpose.  However we are not sure how to have the period and year to be dynamically derived in filename.
    I have read in sdn a number of posted messages on a similar topic and many have suggested a 'How-to' paper titled "How to Extract data with Open Hub to a Logical Filename".  However i could not seem to be able to get document from the link given. 
    Just wonder if anyone has the correct or latest link to the document, or would appreciate if you could share the document with all in sdn if you have a copy.
    Many thanks and best regards,
    Victoria

    Hi,
    After creating open hub press F1 in Application server file name text box from the help window there u Click on Maintain 'Client independent file names and file paths'  then u will be taken to the Implementation guide screen > click on Cross client maintanance of file name > create a logical file path by clicking on new entiries > after creating logical file path now go to Logical file name definition there give your Logical file , name , physical file (ur file name followed by month or year what ever is applicable (press f1 for more info)) , data format (ASC) , application area (BW) and logical path (choose from F4 selection which u have created first), now goto Assignment of  physical path to logical path > give syntax group >physical path is the path u gave at logical file name definition.
    however we have created a logical path file name to identify the file by sys date but ur requirement seems to be of dynamic date of tranaction data...may u can achieve this by creating a variable. U can see the help from F1 that would be of much help to u. All the above steps i have explained will help u create a dynamic logical file.
    hope this helps u to some extent.
    Regards

  • How to export data with column headers in sql server 2008 with bcp command?

    Hi all,
    I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i
    am trying to import data with bcp command data has been copied but column names are not came.
    I am using the below query:-
    EXEC master..xp_cmdshell
    'BCP "SELECT  * FROM   [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'
    Thanks,
    SAAD.

    Hi All,
    I have done as per your suggestion but here i have face the below problem, in print statment it give correct query, in EXEC ( EXEC master..xp_cmdshell @BCPCMD) it was displayed error message like below
    DECLARE @BCPCMD
    nvarchar(4000)
    DECLARE @BCPCMD1
    nvarchar(4000)
    DECLARE @BCPCMD2
    nvarchar(4000)
    DECLARE @SQLEXPRESS
    varchar(50)
    DECLARE @filepath
    nvarchar(150),@SQLServer
    varchar(50)
    SET @filepath
    = N'"D:\Temp\LDH_SQLErrorlog_'+CAST(YEAR(GETDATE())
    as varchar(4))
    +RIGHT('00'+CAST(MONTH(GETDATE())
    as varchar(2)),2)
    +RIGHT('00'+CAST(DAY(GETDATE())
    as varchar(2)),2)+'.log" '
    Set @SQLServer
    =(SELECT
    @@SERVERNAME)
    SELECT @BCPCMD1
    = '''BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT '
    SELECT @BCPCMD2
    = '-c -t , -T -S '
    + @SQLServer + 
    SET @BCPCMD
    = @BCPCMD1+ @filepath 
    + @BCPCMD2
    Print @BCPCMD
    -- Print out below
    'BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername'
    EXEC
    master..xp_cmdshell
    @BCPCMD
      ''BCP' is not recognized as an internal or external command,
    operable program or batch file.
    NULL
    if i copy the print ourt put like below and excecute the CMD it was working fine, could you please suggest me what is the problem in above query.
    EXEC
    master..xp_cmdshell
    'BCP "SELECT  * FROM  
    [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername '
    Thanks, SAAD.

  • How to read data from a file that was formatted by excel?

    Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?

    http://jakarta.apache.org/poi/hssf/index.html
    HSSF stands for Horrible Spreadsheet Format, but it still works!

  • Error in Reading data from a xml file in ESB

    Hi,
    i created a inbound file adapter service which reads data from a xml file and passes it to the routing service and from there updates to the database.....
    (everything created in jdeveloper)
    But i am getting error....it is not getting updated to the database...when i check the database(select * from table) its showing one row selected but i couldnt find the data....
    Transformation mapping also i did...
    i think may be some error in reading the data from the xml file but not so sure.....
    please reply to this mail as soon as possible its very urgent

    Michael R wrote:
    The target table will be created when you execute the interface, if you set the option on the flow tab as instructed in step #6 of the "Setting up ODI Constraint on CLIENT Datastore" Section.
    Option     Value
    CREATE_TARG_TABLE      trueHi Michel,
    This was not my required answer.I am sorry that I was unable to clarify my question.Actually
    +This project executed successfully with some warning.Target Table is automatically created in database and also populated with data.But when I right-click Target Datastore(in >Mapping Tab of the Interface), and then select Data to View Data that needs to be inserted in the target table.I get some error like this:-...+This above line is the result of my project my problem is
    when I right-click Target Datastore(in Mapping Tab of the Interface), and then select Data to View Data that already inserted in the target table.Is not shown by the view data operation.
    I meant to say I am facing this error
    At the10(1010 written) step of
    Creating a New ODI Interface to Perform XML File to RDBMS Table Transformation
    wehre it says
    Open the Interface tab. Select Mapping tab, right-click Target Datastore - CLIENT, and then select Data. View Data inserted in the target table. Close Data Editor. Close the tabs...
    In my case when I use my sqldeveloper I can see data successfully inserted in my target table and also in error table (data that can't satisfy the constraint) .But I was unable to check this by following the above mentioned 10 th step and got this error.
    Thanks

Maybe you are looking for

  • GPS nokia 5800 Xpressmusic

    Hi, I'm from Romania and I want to use GPS for free but i can't.I don't lnow how work.Where is the download for Gps for my Nokia,how to install?Thanks! I have already installed Maps but don't work,i can't see the maps.

  • One to One mapping

    Hi, I have an object A having one to one relation with object B. Object A has these fields id - long name - String order - ValueHolderinterface (for object B) object B has these fields order_id - long order_type - String I am using ExpressionBuilder

  • Background Pictures Changes to Default

    Each time I reboot my iMac (not very often), my desktop picture always reverts to the Leopard Default, my Macbook doesn't suffer this fate, I've looked everywhere and cant see what is causing this odd behaviour. Has anyone else out there suffered the

  • Problem importing .vpe into After Effects CC 2014

    I am having Issues importing .vpe files exported from Photoshop CC 2014 (2014.1.0 - most recent update to date) into After Effects CC 2014 (13.0.2.3 - latest update to date) on Mac OSX Mavericks 10.9.4. After a (lengthy) couple of chats to Adobe cust

  • Stuck on Language select during installation

    This is coming via my brother who is reinstalling Leopard. He is using the disk that came with his laptop and when he gets to the language screen, it gets stuck on language select. He cannot click continue, and cannot even chose to select another lan