Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how to select chars with ascii > 127 on different platforms

Re: how to select chars with ascii > 127 on different platforms

From: Bob Hairgrove <rhairgroveREMOVE_at_THISbigfoot.com>
Date: Wed, 06 Aug 2003 21:02:59 GMT
Message-ID: <3f316c7b.5982973@news.webshuttle.ch>


On Wed, 06 Aug 2003 15:29:28 +0200, alederer <alederer_at_gmx.at> wrote:

>hallo!
>
>i have problems retrieving the correct values from char columns on
>different platforms (windows, solaris).
>
>i have created the following table
>create table charsettest(a_key integer, a_character char(10));
>on oracle 8.1.7 on windows 2000.
>
>then i have inserted the following:
>insert into charsettest(1, chr(180));
>
>when i issue the following select in sqlplus (on both platforms
>connected to the same database)
>select ascii(a_character) from charsettest;
>i get the output:
>ASCII(A_CHARACTER)
>------------------
> 180
>
>this looks ok.
>
>now i have a embedded sql program written in c++ using the oracle
>dynamic sql method4 (sqlda->T[0]=5)
>
>calling this program under windows i get the following:
>
>when fetching "select a_character from charsettest" i get the value
>(unsigned char)*sqlda->V[0] == 180
>which is ok.
>
>calling this program under solaris (connection to the same database
>under windows) with the same select i get the value:
>(unsigned char)*sqlda->V[0] == 39
>which is, i think, not ok !?
>
>my questions:
>how is this possible?
>
>is it possible that there is a problem with different NLS settings?
>
>how can i avoid this? i need a application which retrieves the database
>values without any conversion! is this possible whichout influence of
>NLS settings?
>

There is probably a conversion in code pages taking place between Solaris and Windows. I don't know how you are connecting, but in ODBC you would typically use a "translation DLL" to correct the conversion.

--
Bob Hairgrove
rhairgroveNoSpam_at_Pleasebigfoot.com
Received on Wed Aug 06 2003 - 16:02:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US