Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2006
    Posts
    2

    Unanswered: character set problems...

    Hi,

    first some basic informations:
    - i'm coding in c using the OCI client library

    i have some problems to understand how to manage character set related problems with oracle.

    the following situation is given:

    - my application is using ISO 8859-1 internal
    - the database is using any character set. maybe ISO 8859-1 too, but i don't know that.

    When I start a query to the database for example:

    INSERT INTO customers (name) VALUES ('Günther')

    how to tell oracle, that the charset of this query string should be expected to be in latin 1?

    The same problem come across when i want to query strings from the database. how to tell oracle, that i want to receive any strings in latin 1?

    I expected something like the possibility to setup the applications character set on the environment handle but i just found the OCI_ATTR_CHARSET_ID with witch i managed to tell oracle the character set in witch i like to receive values, but i have to setup this with any define.

    i would be really thankful if someone can give me some hints/suggestions .

    thanks in advance
    template

  2. #2
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    The environment variable NLS_LANG tells Oracle which locale settings the clients running on this machine are using. It is constructed like this :

    LANGUAGE_TERRITORY.CHARSET

    Examples :

    FRENCH_FRANCE.UTF8
    AMERICAN_AMERICA.WE8ISO8859P1

    Mainly, LANGUAGE is used for message display and some sort operations while TERRITORY is used for standard date formats. There are other implications which are detailed in the documentation I pointed you to. The character set tells Oracle to convert data coming from the client from to the db charset to this one and data coming from the db from the db charset to this charset.

    Here is the list of valid languages, territories and character sets. Among others, WE8ISO8859P1 is ISO Latin-1 and WE8MSWIN1252 is Windows Latin-1.

    HTH & Regards,

    rbaraer
    ORA-000TK : No bind variable detected... Shared Pool Alert code 5 - Nuclear query ready .

  3. #3
    Join Date
    Apr 2006
    Posts
    2
    thanks for the quick response.

    yes i found this environment variable, too but there are two problems. at first, if i understand it right, on windows its not an environment variable but a registry key. but i cant change the value of the registry key, because the setting is only true for my application but not for any others, so i need a setting that i can change for my local application only.

  4. #4
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    I've got the same problem but my programs are running on a Linux platform, so my solution might not work for you. What I do is create a launch script for each application in which I set NLS_LANG to the correct value for this application and then call the executable file, so that in my application's shell the variable is correctly set. Something like a file called launch_prog1.sh that would contain :

    EXPORT NLS_LANG = AMERICAN_AMERICA.UTF8
    ./prog1

    Sorry but I'm not a expert for doing such things in Windows . Can it work like this in Windows too ? Would setting the environment variable in a bat file and then call your program from this file too only set the env variable for your application ?

    HTH & Regards,

    rbaraer
    ORA-000TK : No bind variable detected... Shared Pool Alert code 5 - Nuclear query ready .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •