Results 1 to 3 of 3

Thread: bcp question

  1. #1
    Join Date
    Aug 2006
    Posts
    56

    Unanswered: bcp question

    My data file has two fields, but the target table has three. The one missing is a required column.

    So the file looks like this...

    00000 address1
    00001 address2


    The table is defined like this...

    Col 1 = Zip
    Col 2 = Address
    Col 3 = Update Date (Not Null)

    I have been playing around with the format file, but I can't seem to get it right. I get an error "No default value available, NULL not allowed for col 3". I tried to delete the third col from the format file and I get other errors.


    10.0
    3
    1 SYBCHAR 0 5 " " 1 zip
    2 SYBCHAR 0 50 "\r\n" 2 addr
    3 SYBCHAR 0 50 "" 3 updt_date

  2. #2
    Join Date
    Sep 2006
    Posts
    15
    1 create a table with the 2 fields
    2 bcp-in on the 2field table
    3 insert targettable select *,"" from 2field

  3. #3
    Join Date
    Aug 2006
    Posts
    56
    Thanks Eddie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •