<?xml version="1.0" encoding="UTF-8"?>
<!-- Bulk Load Configuration XML Schema -->
<!-- DataDirect Technologies -->

<!-- Restrictions for use of attributes with DataDirect Bulk Load -->
<!-- ============================================================ -->
<!-- -->
<!-- Length is required for CHAR, VARCHAR, UNICODE_CHAR, UNICODE_VARCHAR, BINARY, and VARBINARY types -->
<!-- Precision is required for NUMERIC and DECIMAL types -->
<!-- Scale is required for NUMERIC and DECIMAL types and DATETIME types that may specify fractional seconds -->
<!-- The absence of the Nullable attribute indicates the Nullablity of the column is unknown -->
<!-- -->
<!-- IANA Codepage Names generated from http://www.iana.org/assignments/character-sets -->
<!-- -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:xsd="undefined">

  <xs:element name="table">

    <xs:complexType>

      <xs:sequence maxOccurs="1">
        <xs:element name="row" maxOccurs="1">
          <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
              <xs:element name="column" minOccurs="1" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="sourcecodepage" type="codePage" use="optional"/>
                  <xs:attribute name="externalfilecodepage" type="codePage" use="optional"/>
                  <xs:attribute name="datatype" use="required" type="dataType"/>
                  <xs:attribute name="length" type="xs:integer" use="optional" />
                  <xs:attribute name="precision" type="xs:integer" use="optional"/>
                  <xs:attribute name="scale" type="xs:integer" use="optional"/>
                  <xs:attribute name="nullable" type="xs:boolean" use="optional"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>

      <xs:attribute name="codepage" use="required" type="codePage"/>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="codePage">
    <xs:restriction base="xs:string">
        <xs:enumeration value="us-ascii"/>
        <xs:enumeration value="us-ascii"/> 
        <xs:enumeration value="iso-8859-1"/> 
        <xs:enumeration value="iso-8859-2"/> 
        <xs:enumeration value="iso-8859-3"/> 
        <xs:enumeration value="iso-8859-4"/>
        <xs:enumeration value="iso-8859-5"/>
        <xs:enumeration value="iso-8859-7"/>
        <xs:enumeration value="iso-8859-8"/>
        <xs:enumeration value="iso-8859-9"/>
        <xs:enumeration value="Shift_JIS"/> 
        <xs:enumeration value="euc-jp"/> 
        <xs:enumeration value="KS_C_5601"/> 
        <xs:enumeration value="iso-2022-kr"/> 
        <xs:enumeration value="euc-kr"/>
        <xs:enumeration value="iso-2022-jp"/> 
        <xs:enumeration value="gb2312"/> 
        <xs:enumeration value="iso-8859-13"/> 
        <xs:enumeration value="iso-8859-15"/>
        <xs:enumeration value="GBK"/> 
        <xs:enumeration value="IBM850"/> 
        <xs:enumeration value="IBM852"/> 
        <xs:enumeration value="IBM437"/> 
        <xs:enumeration value="IBM862"/> 
        <xs:enumeration value="Big5"/>
        <xs:enumeration value="MACINTOSH"/> 
        <xs:enumeration value="IBM037"/> 
        <xs:enumeration value="IBM273"/> 
        <xs:enumeration value="IBM277"/> 
        <xs:enumeration value="IBM278"/> 
        <xs:enumeration value="IBM280"/> 
        <xs:enumeration value="IBM284"/> 
        <xs:enumeration value="IBM285"/> 
        <xs:enumeration value="IBM290"/> 
        <xs:enumeration value="IBM297"/> 
        <xs:enumeration value="IBM420"/> 
        <xs:enumeration value="IBM424"/> 
        <xs:enumeration value="IBM500"/> 
        <xs:enumeration value="IBM855"/> 
        <xs:enumeration value="IBM857"/> 
        <xs:enumeration value="IBM860"/> 
        <xs:enumeration value="IBM861"/> 
        <xs:enumeration value="IBM863"/> 
        <xs:enumeration value="IBM864"/> 
        <xs:enumeration value="IBM865"/> 
        <xs:enumeration value="IBM869"/> 
        <xs:enumeration value="IBM870"/> 
        <xs:enumeration value="IBM871"/>  
        <xs:enumeration value="IBM1026"/> 
        <xs:enumeration value="koi8-r"/> 
        <xs:enumeration value="hz-gb-2312"/> 
        <xs:enumeration value="IBM866"/> 
        <xs:enumeration value="IBM775"/> 
        <xs:enumeration value="IBM00858"/> 
        <xs:enumeration value="IBM01140"/> 
        <xs:enumeration value="IBM01141"/> 
        <xs:enumeration value="IBM01142"/> 
        <xs:enumeration value="IBM01143"/> 
        <xs:enumeration value="IBM01144"/> 
        <xs:enumeration value="IBM01145"/> 
        <xs:enumeration value="IBM01146"/> 
        <xs:enumeration value="IBM01147"/> 
        <xs:enumeration value="IBM01148"/> 
        <xs:enumeration value="IBM01149"/> 
        <xs:enumeration value="windows-1250"/> 
        <xs:enumeration value="windows-1251"/> 
        <xs:enumeration value="windows-1252"/> 
        <xs:enumeration value="windows-1253"/> 
        <xs:enumeration value="windows-1254"/>
        <xs:enumeration value="windows-1255"/>
        <xs:enumeration value="windows-1256"/> 
        <xs:enumeration value="windows-1257"/>
        <xs:enumeration value="windows-1258"/> 
        <xs:enumeration value="windows-874"/>
        <xs:enumeration value="IBM-939"/> 
        <xs:enumeration value="IBM-943_P14A-2000"/> 
        <xs:enumeration value="IBM-4396"/> 
        <xs:enumeration value="IBM-5026"/> 
        <xs:enumeration value="IBM-5035"/>
        <xs:enumeration value="UTF-8"/>
        <xs:enumeration value="UTF-16LE"/>
        <xs:enumeration value="UTF-16BE"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="dataType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="BIT"/>
      <xs:enumeration value="TINYINT"/>
      <xs:enumeration value="SMALLINT"/>
      <xs:enumeration value="INTEGER"/>
      <xs:enumeration value="BIGINT"/>
      <xs:enumeration value="FLOAT"/>
      <xs:enumeration value="REAL"/>
      <xs:enumeration value="DOUBLE"/>
      <xs:enumeration value="NUMERIC"/>
      <xs:enumeration value="DECIMAL"/>
      <xs:enumeration value="CHAR"/>
      <xs:enumeration value="VARCHAR"/>
      <xs:enumeration value="LONGVARCHAR"/>
      <xs:enumeration value="UNICODE_CHAR"/>
      <xs:enumeration value="UNICODE_VARCHAR"/>
      <xs:enumeration value="UNICODE_LONGVARCHAR"/>
      <xs:enumeration value="DATE"/>
      <xs:enumeration value="TIME"/>
      <xs:enumeration value="DATETIME"/>
      <xs:enumeration value="DATETIME_WITH_TZ"/>
      <xs:enumeration value="BINARY"/>
      <xs:enumeration value="VARBINARY"/>
      <xs:enumeration value="LONGVARBINARY"/>
      <xs:enumeration value="NULL"/>
      <xs:enumeration value="DISTINCT"/>
      <xs:enumeration value="BLOB"/>
      <xs:enumeration value="CLOB"/>
      <xs:enumeration value="REF"/>
      <xs:enumeration value="BOOLEAN"/>
      <xs:enumeration value="ROWID"/>
      <xs:enumeration value="NCHAR"/>
      <xs:enumeration value="NVARCHAR"/>
      <xs:enumeration value="LONGNVARCHAR"/>
      <xs:enumeration value="NCLOB"/>
      <xs:enumeration value="UNSIGNED_TINYINT"/>
      <xs:enumeration value="UNSIGNED_SMALLINT"/>
      <xs:enumeration value="UNSIGNED_INTEGER"/>
      <xs:enumeration value="UNSIGNED_BIGINT"/>
      <xs:enumeration value="DECFLOAT_16"/>
      <xs:enumeration value="DECFLOAT_34"/>
      <xs:enumeration value="SINGLE_PRECISION"/>
      <xs:enumeration value="DOUBLE_PRECISION"/>
      <xs:enumeration value="INTERVAL_MONTH"/>
      <xs:enumeration value="INTERVAL_YEAR"/>
      <xs:enumeration value="INTERVAL_YEAR_TO_MONTH"/>
      <xs:enumeration value="INTERVAL_DAY"/>
      <xs:enumeration value="INTERVAL_HOUR"/>
      <xs:enumeration value="INTERVAL_MINUTE"/>
      <xs:enumeration value="INTERVAL_SECOND"/>
      <xs:enumeration value="INTERVAL_DAY_TO_HOUR"/>
      <xs:enumeration value="INTERVAL_DAY_TO_MINUTE"/>
      <xs:enumeration value="INTERVAL_DAY_TO_SECOND"/>
      <xs:enumeration value="INTERVAL_HOUR_TO_MINUTE"/>
      <xs:enumeration value="INTERVAL_HOUR_TO_SECOND"/>
      <xs:enumeration value="INTERVAL_MINUTE_TO_SECOND"/>
      <xs:enumeration value="GUID"/>
      <xs:enumeration value="XML_TEXT"/>
      <xs:enumeration value="XML_BINARY"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
