dbcoltype() , char and nchar
LacaK <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
Hi,
there is in db-lib function dbcoltype, which returns result column datatype.
on CHAR column it returns SQLCHAR (SYBCHAR)
on VARCHAR it returns also SQLCHAR
on NCHAR, NVARCHAR it returns also SQLCHAR ... but here I need
distinguish between CHAR and NCHAR (NATIONAL CHAR - UNICODE CHAR)
Is there any way how to get this more detailed column info (in example
below is it wtype/wsize, column "nchar_field" is defined as nchar(10))?
If not, is there way how to extend (dbcolinfo?) and/or add some function
or parameter which will solve this problem ?
(I am writing SQLConnector component for FreePascal project, which is
going to use FreeTDS db-lib and I need this info to correctly create
Fields in client DataSet)
freetds.log:
IF CLIENT CHARSET IS "ISO-8859-1":
...
token.c:1542:tds7_get_data_info:
colname = nchar_field (11 bytes)
type = 47 (char)
server's type = 239 (x UCS-2 char)
column_varint_size = 2
column_size = 10 (20 on server)
token.c:1612: name size/wsize type/wtype utype
token.c:1613: -------------------- --------------- --------------- -------
token.c:1623: nchar_field 10/20 47/239 0
...
IF CLIENT CHARSET IS "UTF-8":
...
token.c:1542:tds7_get_data_info:
colname = nchar_field (11 bytes)
type = 47 (char)
server's type = 239 (x UCS-2 char)
column_varint_size = 2
column_size = 40 (20 on server)
token.c:1612: name size/wsize type/wtype utype
token.c:1613: -------------------- --------------- --------------- -------
token.c:1623: nchar_field 40/20 47/239 0
...
Please let me know
Thanks
-Laco.
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds