Home > Archive > MS SQL XML > January 2006 > using SQLXMLBulkLoad to insert a single blank into a non-nullable column









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author using SQLXMLBulkLoad to insert a single blank into a non-nullable column
jayMeer

2006-01-27, 8:24 pm

I'm trying to insert a single space as the value into a non-nullable
column. The column definition in the SQL database / table is

ship_to_code (varchar(8), Not Null)

The xsd (in file atf.xsd) describes the element as

<xsd:element name="ship_to_code" type="xsd:string" />

My map fixes the value of the ship_to_code element as

<ship_to_code>
<xsl:text> </xsl:text>
</ship_to_code>

The output (in file out.xml) from the transformation looks like

<ship_to_code> </ship_to_code>

But when I execute

xmlBulkLoader.Execute("ATF.xsd", "out.xml")

the bulkloader raises the error

***ERROR: No data was provided for column 'ship_to_code' on table
'arinpchg', and this column cannot contain NULL values.

If out.xml shows a single space as the value of the ship_to_code
element, why is it presenting to the bulk loader as a null?

I tried eliminating the ship_to_code element from out.xml and changed
the xsd to

<xsd:element name="ship_to_code" type="xsd:string" minOccurs="0"
default="zzz"/>

hoping to get 'zzz' into the record, but the bulkloader raises the same
error.

What am I doing wrong?

Thanks - J

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com