2 Replies Latest reply: Jun 21, 2013 7:25 AM by archenroot RSS

    odi-1228: string data, right truncation (Working with XML)

    949069
      Hi guys:

      I'm working with XML files and getting a string data, right truncation error when trying to create a XML file.

      I'm trying to insert 380 chars in a filed called MessageData. In the XSD file this field is string type, that allows N characters to insert. When I do the reverse, this field becomes varchar(255), so I already tried to change it to longvarchar 4000, varchar 1000* but I'm always receiving the string data, right truncation.

      Also, I'm using the default JDBC driver: ODI JDBC Driver for XML

      This is the content of XSD file:

      <xs:schema
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.oracle.com/retail/integration/rib/RibMessages"
           xmlns="http://www.oracle.com/retail/integration/rib/RibMessages" >
           <xs:annotation>
           <xs:documentation xml:lang="en">
           Retail Integration Bus Schema. This schema can be used to publish messages to RIB.
           The text data inside messageData and customData should be html encoded.
           </xs:documentation>
           </xs:annotation>
           <xs:element name="RibMessages">
                <xs:complexType>
                     <xs:sequence>
                          <xs:element ref="publishetname" minOccurs="0" maxOccurs="1" />
                          <xs:element ref="ribMessage" minOccurs="1" maxOccurs="unbounded" />
                     </xs:sequence>
                </xs:complexType>
           </xs:element>

           <xs:element name="publishetname" type="string255" />

           <xs:element name="ribMessage">
                <xs:complexType>
                     <xs:sequence>
                          <xs:element ref="family" />
                          <xs:element ref="type" />
                          <xs:element ref="id" minOccurs="0"/>
                          <xs:element ref="ribmessageID" />
                          <xs:element ref="routingInfo" minOccurs="0" maxOccurs="unbounded" />
                          <xs:element ref="publishTime" />
                          <xs:element ref="hospitalID" minOccurs="0" />
                          <xs:element ref="failure" minOccurs="0" maxOccurs="unbounded" />
                          <xs:element ref="messageData" />
                          <xs:element ref="customData" minOccurs="0" />
                          <xs:element ref="customFlag" />
                          <xs:element ref="hospitalRef" minOccurs="0" maxOccurs="unbounded" />
                     </xs:sequence>
                </xs:complexType>
           </xs:element>

           <xs:element name="family" type="string25" />
           <xs:element name="type" type="string30" />
           <xs:element name="id" type="string255" />
           <xs:element name="ribmessageID" type="string255" />

           <xs:element name="routingInfo">
                <xs:complexType>
                     <xs:sequence>
                          <xs:element ref="name" />
                          <xs:element ref="value" />
                          <xs:element ref="detail" minOccurs="0" maxOccurs="2" />
                     </xs:sequence>
                </xs:complexType>
           </xs:element>

           <xs:element name="name" type="string25" />
           <xs:element name="value" type="string25" />

           <xs:element name="detail">
                <xs:complexType>
                     <xs:sequence>
                          <xs:element ref="dtl_name" />
                          <xs:element ref="dtl_value" />
                     </xs:sequence>
                </xs:complexType>
           </xs:element>

           <xs:element name="dtl_name" type="string25" />
           <xs:element name="dtl_value" type="string300" />

           <xs:element name="publishTime" type="ribMessageDateTime" />
           <xs:element name="hospitalID" type="xs:long" />

           <xs:element name="failure">
                <xs:complexType>
                     <xs:sequence>
                          <xs:element ref="time" />
                          <xs:element ref="location" />
                          <xs:element ref="description" />
                     </xs:sequence>
                </xs:complexType>
           </xs:element>

           <xs:element name="time" type="ribMessageDateTime" />
           <xs:element name="location" type="string60" />
           <xs:element name="description" type="string4000" />

           <xs:element name="messageData" type="xs:string" />
           <xs:element name="customData" type="xs:string" />
           <xs:element name="customFlag" type="string1" />

           <xs:element name="hospitalRef">
                <xs:complexType>
                     <xs:sequence>
                          <xs:element ref="message_num" />
                          <xs:element ref="location" />
                          <xs:element ref="message_family" />
                          <xs:element ref="old_reason_code" />
                          <xs:element ref="new_reason_code" />
                     </xs:sequence>
                </xs:complexType>
           </xs:element>

           <xs:element name="message_num" type="xs:long" />
           <xs:element name="message_family" type="string25" />
           <xs:element name="new_reason_code" type="string10" />
           <xs:element name="old_reason_code" type="string10" />


           <xs:simpleType name="string255">
                <xs:restriction base="xs:string">
                     <xs:maxLength value="255" />
                </xs:restriction>
           </xs:simpleType>

           <xs:simpleType name="string25">
                <xs:restriction base="xs:string">
                     <xs:maxLength value="25" />
                </xs:restriction>
           </xs:simpleType>

           <xs:simpleType name="string30">
                <xs:restriction base="xs:string">
                     <xs:maxLength value="30" />
                </xs:restriction>
           </xs:simpleType>

           <xs:simpleType name="string300">
                <xs:restriction base="xs:string">
                     <xs:maxLength value="300" />
                </xs:restriction>
           </xs:simpleType>

           <xs:simpleType name="string60">
                <xs:restriction base="xs:string">
                     <xs:maxLength value="60" />
                </xs:restriction>
           </xs:simpleType>

           <xs:simpleType name="string4000">
                <xs:restriction base="xs:string">
                     <xs:maxLength value="4000" />
                </xs:restriction>
           </xs:simpleType>

           <xs:simpleType name="string1">
                <xs:restriction base="xs:string">
                     <xs:maxLength value="1" />
                </xs:restriction>
           </xs:simpleType>

           <xs:simpleType name="string10">
                <xs:restriction base="xs:string">
                     <xs:maxLength value="10" />
                </xs:restriction>
           </xs:simpleType>
           
           <xs:simpleType name="ribMessageDateTime">
      <xs:restriction base="xs:string">
      <xs:pattern value=
      "\d{4}-\d\d-\d\d \d\d:\d\d:\d\d.\d{3} [A-Z]{3}"/>
      </xs:restriction>
      </xs:simpleType>

      </xs:schema>