Обсуждение: Numeric datatype doesn't match those from older driver version ?

Поиск
Список
Период
Сортировка

Numeric datatype doesn't match those from older driver version ?

От
Lothar Behrens
Дата:
Hi,

I am now using the current ODBC driver (8.3.0400 Unicode) for my
application.
Compared to my SQL_ASCII database installation (and the 07.03.0200
driver version)
I get wrong column type information.

The numbers I get now are negative. I didn't have seen any switch to
change this to be
equal to the old driver.

What is wrong ?

Thanks

Lothar

Re: Numeric datatype doesn't match those from older driver version ?

От
Hiroshi Inoue
Дата:
Lothar Behrens wrote:
> Hi,
>
> I am now using the current ODBC driver (8.3.0400 Unicode) for my
> application.
> Compared to my SQL_ASCII database installation (and the 07.03.0200
> driver version)
> I get wrong column type information.
>
> The numbers I get now are negative.

Maybe you are looking at
    SQL_WCHAR(-8)
    SQL_WVARCHAR(-9)
    SQL_WLONGVARCHAR(-10)
.

 > I didn't have seen any switch to change this to be
> equal to the old driver.

Please use the ANSI version driver.
If you compile the program with win32.mak please type
    nmake /f win32.mak ANSI_VERSION=yes
and you would get psqlodbc30a.dll and pgenlista.dll
instead of psqlodbc35w.dll and pgenlist.dll.

regards,
Hiroshi Inoue

Re: Numeric datatype doesn't match those from older driver version ?

От
Lothar Behrens
Дата:
On Dec 7, 1:55 am, in...@tpf.co.jp (Hiroshi Inoue) wrote:
> Lothar Behrens wrote:
> > Hi,
>
> > I am now using the current ODBC driver (8.3.0400 Unicode) for my
> > application.
> > Compared to my SQL_ASCII database installation (and the 07.03.0200
> > driver version)
> > I get wrong column type information.
>
> > The numbers I get now are negative.
>
> Maybe you are looking at
>         SQL_WCHAR(-8)
>         SQL_WVARCHAR(-9)
>         SQL_WLONGVARCHAR(-10)
> .
>
>  > I didn't have seen any switch to change this to be
>
> > equal to the old driver.
>
> Please use the ANSI version driver.
> If you compile the program with win32.mak please type
>         nmake /f win32.mak ANSI_VERSION=yes
> and you would get psqlodbc30a.dll and pgenlista.dll
> instead of psqlodbc35w.dll and pgenlist.dll.
>

Isn't UTF-8 the unicide version ?
My database is encoded with that.

Lothar

> regards,
> Hiroshi Inoue
>
> --
> Sent via pgsql-odbc mailing list (pgsql-o...@postgresql.org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-odbc


Re: Numeric datatype doesn't match those from older driver version ?

От
Hiroshi Inoue
Дата:
Lothar Behrens wrote:
> On Dec 7, 1:55 am, in...@tpf.co.jp (Hiroshi Inoue) wrote:
>> Lothar Behrens wrote:

>> Please use the ANSI version driver.
>> If you compile the program with win32.mak please type
>>         nmake /f win32.mak ANSI_VERSION=yes
>> and you would get psqlodbc30a.dll and pgenlista.dll
>> instead of psqlodbc35w.dll and pgenlist.dll.
>
> Isn't UTF-8 the unicide version ?
> My database is encoded with that.

You can handle the UTF-8 database with Unicode or
ANSI version driver.
If you would handle the (var)char data as UTF-8
strings, please use the ANSI driver.
If you would handle the (var)char data as UTF-16
strings, please use the Unicode driver.

regards,
Hiroshi Inoue

Re: Numeric datatype doesn't match those from older driver version ?

От
Lothar Behrens
Дата:
On 14 Dez., 01:50, in...@tpf.co.jp (Hiroshi Inoue) wrote:
> Lothar Behrens wrote:
> > On Dec 7, 1:55 am, in...@tpf.co.jp (Hiroshi Inoue) wrote:
> >> Lothar Behrens wrote:
> >> Please use the ANSI version driver.
> >> If you compile the program with win32.mak please type
> >>         nmake /f win32.mak ANSI_VERSION=yes
> >> and you would get psqlodbc30a.dll and pgenlista.dll
> >> instead of psqlodbc35w.dll and pgenlist.dll.
>
> > Isn't UTF-8 the unicide version ?
> > My database is encoded with that.
>
> You can handle the UTF-8 database with Unicode or
> ANSI version driver.
> If you would handle the (var)char data as UTF-8
> strings, please use the ANSI driver.
> If you would handle the (var)char data as UTF-16
> strings, please use the Unicode driver.
>

Thank you,

that works great.

Lothar

> regards,
> Hiroshi Inoue
>
> --
> Sent via pgsql-odbc mailing list (pgsql-o...@postgresql.org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-odbc


Re: Numeric datatype doesn't match those from older driver version ?

От
"Adam M"
Дата:
On Sat, Dec 13, 2008 at 6:50 PM, Hiroshi Inoue <inoue@tpf.co.jp> wrote:
> You can handle the UTF-8 database with Unicode or
> ANSI version driver.
> If you would handle the (var)char data as UTF-8
> strings, please use the ANSI driver.
> If you would handle the (var)char data as UTF-16
> strings, please use the Unicode driver.

I did not know that! I've always *assumed* that ASCII version was for
ASCII databases only. ASCII generally means 7-bit encoding, not 8-bit
like UTF-8.

Maybe a better name for the drivers would be,
   psqlodbc.msi
   psqlodbc-multibyte.msi

and most Windows users (I hope) would assume what you wrote.

- Adam

Re: Numeric datatype doesn't match those from older driver version ?

От
"Dave Page"
Дата:
On Wed, Dec 17, 2008 at 8:10 PM, Adam M <gnuman1@gmail.com> wrote:
> I did not know that! I've always *assumed* that ASCII version was for
> ASCII databases only. ASCII generally means 7-bit encoding, not 8-bit
> like UTF-8.

ANSI, not ASCII in this case. And feel free to blame Microsoft for the
convention :-)

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Numeric datatype doesn't match those from older driver version ?

От
"Adam M"
Дата:
On Wed, Dec 17, 2008 at 2:14 PM, Dave Page <dpage@pgadmin.org> wrote:
> On Wed, Dec 17, 2008 at 8:10 PM, Adam M <gnuman1@gmail.com> wrote:
>> I did not know that! I've always *assumed* that ASCII version was for
>> ASCII databases only. ASCII generally means 7-bit encoding, not 8-bit
>> like UTF-8.
>
> ANSI, not ASCII in this case. And feel free to blame Microsoft for the
> convention :-)

http://en.wikipedia.org/wiki/ANSI_art

I do blame Microsoft if they are calling UTF-8 ANSI? To me ANSI was
back in the 1980s with BBSs and extended ASCII codes. ANSI terminals
allowed scrolling around, etc..

Thanks for the clarification!

- Adam

Re: Numeric datatype doesn't match those from older driver version ?

От
"Dave Page"
Дата:
On Thu, Dec 18, 2008 at 5:33 AM, Adam M <gnuman1@gmail.com> wrote:
>
> http://en.wikipedia.org/wiki/ANSI_art
>
> I do blame Microsoft if they are calling UTF-8 ANSI? To me ANSI was
> back in the 1980s with BBSs and extended ASCII codes. ANSI terminals
> allowed scrolling around, etc..

It comes from the Microsoft conventions that sprung up when they added
the Unicode APIs. For function CreateFoo, they created CreateFooA and
CreateFooW - the A version being the ANSI, the W being the Wide
character (or Unicode UTF-16). If you program without the UNICODE
macro defined, CreateFoo maps to CreateFooA, otherwise to CreateFooW.

In the ODBC driver world, the ANSI drivers can be made to handle
multibyte characters through the ANSI interface, however, if you want
'proper' UTF-16 support used natively by modern versions of Windows,
you need the Unicode API extensions. psqlODBC kinda stretches this to
the limits with the multibyte support in the ANSI driver, which
doesn't play well with the UTF-16 support with some applications -
hence the use of two drivers.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com