Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2014
    Posts
    2

    Unanswered: DB2 LOAD - how to load into BINARY field

    Hi! Please help!

    I have no experience in DB2. I just need to prepare csv file for DB2 database (DB2 for z/OS v10). When our DB2 administrator is trying to load my file he receives a message:
    -DBK1 266 15:00:43.28 DSNURCON - INPUT FIELD 'HASH',
    INVALID FOR 'TST.T1',
    ERROR CODE '12 - INPUT VARCHAR FIELD IS TOO LONG'

    'HASH' field is Binary(32). And value for this field is represented in csv like:
    "BE13C5A7A7DFA935F59BBD4CABA8864701CAC362000000000 000000000000000"

    It works perfect in MS SQL, but fails in DB2. How should I prepare data for binary(32) field in DB2?

    Sorry for my English guys.

  2. #2
    Join Date
    Sep 2013
    Location
    India
    Posts
    246
    Quote Originally Posted by morgan_ru View Post
    Hi! Please help!

    I have no experience in DB2. I just need to prepare csv file for DB2 database (DB2 for z/OS v10). When our DB2 administrator is trying to load my file he receives a message:
    -DBK1 266 15:00:43.28 DSNURCON - INPUT FIELD 'HASH',
    INVALID FOR 'TST.T1',
    ERROR CODE '12 - INPUT VARCHAR FIELD IS TOO LONG'

    'HASH' field is Binary(32). And value for this field is represented in csv like:
    "BE13C5A7A7DFA935F59BBD4CABA8864701CAC362000000000 000000000000000"

    It works perfect in MS SQL, but fails in DB2. How should I prepare data for binary(32) field in DB2?

    Sorry for my English guys.


    Please post the data type / width for this field in target table ? If it is Binary(32), than yours input string is too long for it . Your input is 64 in length.
    ssumit

  3. #3
    Join Date
    Sep 2014
    Posts
    2
    Yes, it's binary(32). And I know that my string is 64 characters long because I'm trying to load it as HEX. This is how you bulk insert binary data in MS SQL. I hope that someone tell me how to load binary field in DB.

  4. #4
    Join Date
    Sep 2013
    Location
    India
    Posts
    246
    Db2 is taking your input as VARCHAR that why giving error as below:

    "INPUT VARCHAR FIELD IS TOO LONG"

    I haven't done this before but i believe You need to load this in table first and than cast / convert it. Load is not understanding this as HEXA / BINARY.

    By the way what this HASH is? is it Digital certificate encryption string ?
    ssumit

Posting Permissions

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