Skip to Content.
Sympa Menu

freetds - Re: how to tell nchar from char

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: how to tell nchar from char
  • Date: Tue, 26 Jun 2001 20:43:38 -0400 (EDT)



TDSCOLINFO->column_xtype should do the trick, however it's extremely
non-portable so use at your own risk.

Brian

On Tue, 26 Jun 2001, Mark J. Lilback wrote:

> I'm using TDS 4.2 and dblib, and am running into a problem with
> matching column types.
>
> To start, once my application opens a database connection, it does a
> query to get a list of supported data types, which I store in an
> object for each type. When a user executes a query, I then need to
> figure out the corresponding data type object for each column in the
> result set. This is where it is getting tricky.
>
> I was using the systype.type (SYS_TYPE) value, which is what
> dbcoltype() returns. However, this returns 47 for both char and nchar
> columns.
>
> I have plenty of other values to work with in my data type objects
> (the odbc data type code, the sql data type code, and the user type
> code (all of which are different between char and nchar). However, I
> can't figure out how to get any of these values from a result set.
>
> TDSCOLINFO->column_type has a value of 39 for a char field, which
> dbcoltype() is conditionalized to return 47 for. But I don't see
> anyway to get the 39 value from any of the master tables for the char
> datatype.
>
> Any ideas on what I can do? I'm thinking I'll need to default down to
> never matching unicode text objects to result set columns, but I'd
> prefer a better solution.
>
> Thanks.
>
>




  • how to tell nchar from char, Mark J. Lilback, 06/26/2001
    • <Possible follow-up(s)>
    • Re: how to tell nchar from char, Brian Bruns, 06/26/2001

Archive powered by MHonArc 2.6.24.

Top of Page