freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: LacaK <lacak AT zoznam.sk>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] dbcoltype() , char and nchar
- Date: Tue, 21 Sep 2010 12:29:32 +0200
Fine ;-) Thanks (I am not native speaker, so sometimes I have problems explain what I want)Only for explanation:
In FreePascal there are different Database Field Types
TStringField and TWideStringField, so my attempt was map
char, varchar to TStringField
nchar, nvarchar to TWideStringField (see http://docwiki.embarcadero.com/VCL/en/DB.TWideStringField )
(text to TMemoField, ntext to TWideMemoField)
I understand what you want to do.
Unfortunately it will be quiteYes, I can re-convert easy (UTF8 -> WideString), but as I wrote I must know original server's column type
difficult with db-lib, because FreeTDS intentionally conceals the server
column definition. It was a design decision -- maybe not the right one!
-- but it's very deep in the library.
As soon as UCS-2 data arrive from the server, they are immediately
converted to the client's encoding. The UCS-2 form is discarded.[1] To
provide UCS-2 data to FreePascall, you'll have to re-convert!
When speaking about client encodings, there are supported: ISO-8859-1, UTF8, UCS2, arn't ?
Is there possibility obtain character data in current system Ansi (non-unicode) charset ?
(here I am speaking about Windows environment, I do not know nothing about other OS). In Windows there is for example WideCharToMultiByte(CP_ACP, ...)
Getting db-lib to report the server's type and size wouldn't beThanks. I understand, and I can do it for my own needs, but as I wrote, my FreePascal component will link to dblib.dll.
particularly hard. The TDSCOLUMN structure has a nested on_server
structure with exactly that information. That structure could be
harmlessly added to the DBCOL structure filled by dbcolinfo(). I think if
you look at dbcolinfo() and dbcoltype(), you'll see what to do. Look at
tds_set_column_type() too.
And I do not want provide specialized/modified/customized version of dblib.dll (so everybody can use=download and compile FreeTDS dblib.dll from www.freetds.org)
So if this functionality will not be included in main stream version of dblib, then I can not use it.
If you agree, that we can add this functionality in some way then I can try do it and post patch ... then please give me direction, which is the preffered method
(for example: extending DBCOL structure by adding:
SHORT ServerType (wType);
DBINT ServerMaxLength (wMaxLength);
-or-
adding new function dbcolwtype()?
-or-
modify existing FreeTDS-only function dbtablecolinfo() which will provide original server's column types?
)
TIA
-Laco.
-
Re: [freetds] dbcoltype() , char and nchar,
James K. Lowden, 09/13/2010
- Re: [freetds] dbcoltype() , char and nchar, Michael Peppler, 09/14/2010
-
Re: [freetds] dbcoltype() , char and nchar,
LacaK, 09/16/2010
-
Re: [freetds] dbcoltype() , char and nchar,
James K. Lowden, 09/20/2010
- Re: [freetds] dbcoltype() , char and nchar, LacaK, 09/21/2010
-
Re: [freetds] dbcoltype() , char and nchar,
James K. Lowden, 09/20/2010
Archive powered by MHonArc 2.6.24.