Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Alter session on NLS_DATE_FORMAT being ignored

This is a discussion on Alter session on NLS_DATE_FORMAT being ignored within the Oracle Database forums, part of the Database category; I'm issuing an alter session setting NLS_DATE_FORMAT in a C batch process right after the connection takes place. The format ...

  1. #1
    jmath is offline Junior Member Array
    Join Date
    Feb 2011
    Answers
    1

    Alter session on NLS_DATE_FORMAT being ignored

    I'm issuing an alter session setting NLS_DATE_FORMAT in a C batch
    process right after the connection takes place. The format I specify
    is YYYYMMDDHH24MISS, this is the format used all over the process. In
    my development environment this works perfectly, but I've had problems
    in other environments.

    CASE A development environment: The process works fine, $NLS_LANG and
    $NLS_DATE_FORMAT environment variables are not set.

    CASE B Test envirnonment 1: The process failed.
    $NLS_LANG=American_America.WE8ISO8859P1
    $NLS_DATE_FORMAT environment variable is not set.
    For some reason the $NLS_LANG variable seems to have more weight
    than the alter session command.. why?
    The process works fine after setting $NLS_DATE_FORMAT to the
    desired format.

    CASE C Test envirnonment 2: The process failed. $NLS_LANG and
    $NLS_DATE_FORMAT environment variables are not set. Can't get it to
    work here. Any idea why?


  2. #2
    techvinny is offline Moderator Array
    Join Date
    Dec 2010
    Answers
    56
    Try checking the NLS_LANG of your database by running the following sql,
    SELECT * from NLS_DATABASE_PARAMETERS WHERE parameter IN ( 'NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');
    And if you find them as NULL, you can try setting the values on them. To get the possible values for language, territory and characterset you can check the view V$NLS_VALID_VALUES.
    – parameter – possible values LANGUAGE, TERRITORY, CHARACTERSET

    SELECT parameter, value FROM V$NLS_VALID_VALUES;
    Once you decide on the possible values, you can set NLS_LANG by using the export command.

    HTH!!!


Latest Article

Network Security Risk Assessment and Measurement

Read More...