trailing null missing from STR bind value Error
Posted: Mon 05 Jun 2006 08:22
I break the multi-lined text into single lines using following source and insert them into a table using array DML.
However I encounterd the error message at the bottom.
Can you help me out ?
I'm using Oracle 9i and it's charactor set is KO16KSC5601.
if( sSrc.Length > 4000 )
{
int nSeq = 1;
int nCursor = 0, j = 0 ;
char[] buff = sSrc.ToCharArray();
for( j=nCursor; j<sSrc.Length; j++ )
{
if( buff[j] == '\n' )
{
WorkItem workItem = new WorkItem();
workList.Add( workItem );
for( int i=0; i<reader.FieldCount; i++ )
{
int len = (j-nCursor) + 1;
if( i == 5 )
{
workItem.fieldValueList.Add( sSrc.Substring( nCursor, len ) );
}
else if( i == 1 )
{
workItem.fieldValueList.Add( nSeq.ToString() );
}
else
{
workItem.fieldValueList.Add( reader.ToString() );
}
}
nCursor = j+1;
nSeq++;
}
}
if( j == sSrc.Length )
{
int len = sSrc.Length - nCursor;
WorkItem workItem = new WorkItem();
workList.Add( workItem );
for( int i=0; i<reader.FieldCount; i++ )
{
if( i == 5 )
{
workItem.fieldValueList.Add( sSrc.Substring( nCursor, len ) );
}
else if( i == 1 )
{
workItem.fieldValueList.Add( nSeq.ToString() );
}
else
{
workItem.fieldValueList.Add( reader.ToString() );
}
}
}
}
Code : 24381, LineNumber : 0, LinePosition : 0, Message : ORA-24381: error(s) in array DML
2. Code : 1480, LineNumber : 0, LinePosition : 0, Message : ORA-01480: trailing null missing from STR bind value
3. Code : 3106, LineNumber : 0, LinePosition : 0, Message : ORA-03106: fatal two-task communication protocol error
However I encounterd the error message at the bottom.
Can you help me out ?
I'm using Oracle 9i and it's charactor set is KO16KSC5601.
if( sSrc.Length > 4000 )
{
int nSeq = 1;
int nCursor = 0, j = 0 ;
char[] buff = sSrc.ToCharArray();
for( j=nCursor; j<sSrc.Length; j++ )
{
if( buff[j] == '\n' )
{
WorkItem workItem = new WorkItem();
workList.Add( workItem );
for( int i=0; i<reader.FieldCount; i++ )
{
int len = (j-nCursor) + 1;
if( i == 5 )
{
workItem.fieldValueList.Add( sSrc.Substring( nCursor, len ) );
}
else if( i == 1 )
{
workItem.fieldValueList.Add( nSeq.ToString() );
}
else
{
workItem.fieldValueList.Add( reader.ToString() );
}
}
nCursor = j+1;
nSeq++;
}
}
if( j == sSrc.Length )
{
int len = sSrc.Length - nCursor;
WorkItem workItem = new WorkItem();
workList.Add( workItem );
for( int i=0; i<reader.FieldCount; i++ )
{
if( i == 5 )
{
workItem.fieldValueList.Add( sSrc.Substring( nCursor, len ) );
}
else if( i == 1 )
{
workItem.fieldValueList.Add( nSeq.ToString() );
}
else
{
workItem.fieldValueList.Add( reader.ToString() );
}
}
}
}
Code : 24381, LineNumber : 0, LinePosition : 0, Message : ORA-24381: error(s) in array DML
2. Code : 1480, LineNumber : 0, LinePosition : 0, Message : ORA-01480: trailing null missing from STR bind value
3. Code : 3106, LineNumber : 0, LinePosition : 0, Message : ORA-03106: fatal two-task communication protocol error