|
Posted by ChasW on 09/28/56 11:25
I have created a simple table using:
CREATE TABLE table1 (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
data VARCHAR(100)
);
I am able to insert into and query this table as expected.
However, when using ODBC API call to SQLColAttribute with
SQL_DESC_OCTET_LENGTH as the input field identifier I am noticing that
the byte length being returned is failing to include a NULL character
for the column of VARCHAR type.
It is my understanding that SQL_DESC_OCTET_LENGTH is supposed to
include the NULL terminator and that SQL_DESC_LENGTH is supposed to
exclude the NULL terminator for VARCHAR types.
So the question is, do I need to explicitly create the table so that
it NULL terminates varying character strings?
Thanks for reading,
Chas
Navigation:
[Reply to this message]
|