all groups > sql server odbc > october 2004 >
You're in the

sql server odbc

group:

Error mapping Char(1) in db to C datatype


Error mapping Char(1) in db to C datatype JohnD
10/26/2004 6:53:50 PM
sql server odbc:
Hi,

I have a column in a table defined as Char(1). I'm trying to map it in
a call to SQLBindParameter using:

sql type = SQL_CHAR
native type = SQL_C_CHAR
size = 1

However, I'm getting a "string data, right truncation" error. Also, I'm
able to map it and insert data to the column as:

sql type = SQL_CHAR
native type = SQL_C_BIT
size = 1

But the representation is '*' instead of the '1' or '0' I'm using as input.

Any help to clarify my misunderstandings is greatly appreciated.

Thanks,
Re: Error mapping Char(1) in db to C datatype Michael Thomas (Microsoft)
10/29/2004 5:38:01 PM
You need to add space for the null terminator. Set the size to 2.


Thanks
Michael


[quoted text, click to view]

AddThis Social Bookmark Button