You are here: column with type VARCHAR « MySQL Databases « IT news, forums, messages
column with type VARCHAR

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация