Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Posts
    3

    Unanswered: Problem with VARCHAR() FOR BIT DATA column

    Hi all,

    I'm trying to use a VARCHAR() FOR BIT DATA column and I'm running into some strange behavior. I'm using this column to store binary data, and whenever I retrieve this data, it appears that I'm not getting back exactly what I put out. It seems that the last two bytes, or characters that I get back are always not what I've written out. Does anybody know where I can find some information on the FOR BIT DATA column types and how to work with them.

    Thanks
    Nick.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Problem with VARCHAR() FOR BIT DATA column

    Can you please post your create tab, insert and select statement with output .....

    Also, your client and server platforms ..

    Cheers

    Sathyaram

    Originally posted by npalmer
    Hi all,

    I'm trying to use a VARCHAR() FOR BIT DATA column and I'm running into some strange behavior. I'm using this column to store binary data, and whenever I retrieve this data, it appears that I'm not getting back exactly what I put out. It seems that the last two bytes, or characters that I get back are always not what I've written out. Does anybody know where I can find some information on the FOR BIT DATA column types and how to work with them.

    Thanks
    Nick.

  3. #3
    Join Date
    Dec 2002
    Posts
    3

    Re: Problem with VARCHAR() FOR BIT DATA column

    Originally posted by sathyaram_s
    Can you please post your create tab, insert and select statement with output .....

    Also, your client and server platforms ..

    Cheers

    Sathyaram
    Thanks for replying

    I'm doing this thru ODBC in C++ so the insert and select will be a little hard, but here is the table create statement :

    CREATE TABLE TESTIMG (FK INT, SK INT, LD INT, IMAGEDATA VARCHAR(32000) FOR BIT DATA)

    The code I'm using for the select and insert work fine with the ODBC drivers for SQL Server and Oracle, so I'm wondering if I have to do anything special for the AS/400

    Nick.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Problem with VARCHAR() FOR BIT DATA column

    See if this link provides the information you want ...

    http://msdn.microsoft.com/library/de...odbc1_97fm.asp

    Good luck

    Cheers

    Sathyaram

  5. #5
    Join Date
    Dec 2002
    Posts
    3

    Re: Problem with VARCHAR() FOR BIT DATA column

    Originally posted by sathyaram_s
    See if this link provides the information you want ...

    http://msdn.microsoft.com/library/de...odbc1_97fm.asp

    Good luck

    Cheers

    Sathyaram
    Well, sort off but not really. The ODBC driver I'm using from IBM doesn't have a "Process Binary as character" property, so I can't set that. I'm definitely getting data back, its just that the last two bytes/characters are always mangled.

    Nick.

Posting Permissions

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