Internal Message: - Msg 999, Level 11, State 0:
[generic/ctbcp/blk.c/276] ctbcp:executeBulkCopy(): Both terminator and prefix cannot be null for nullable column 6.
bcp copy in failed
The error messages suggests the field terminators are null along with the column. Do you need to use the format file or can you get away with using either character (-c) or native format (-n)?
If you're using the -c you ought to specify field terminators that do not occur in your data. The defaults are , and new line. To change the terminator use the -r and -t parameters; row terminator and field terminator respectively.
The input file is positional, not delimited. I would think the entire file could be nulls, along with every col in the db as nullable, and it should still work. I have to use the format file to say what the positions are.
If you consider blanks a value, then yes: every col will have a value. We have been using the same bcp format files and data files for 10 years.
As to your second question:
Quite easily. Say Colx is positions 57-59 in the flat file. If positions 57-59 are blanks or spaces, this is null. Been that way for years, we are a little stunned Sybase would change the basic operation of bcp after all this time.
Originally posted by richardcrossley
If the file is positional, by definition there must be a value in every column. You might associate a dummy value to "NULL", but as far as Sybase is concerned there will be a value.
If your flat file is going to contain nulls, how are you going to know which columns are null using character positions?
Turns out the answer is -Q on the cmd line of bcp. Not sure why just yet, and not sure why we didn't need them before, but that is definately the fix.