1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Alter session on NLS_DATE_FORMAT being ignored

Discussion in 'General' started by jmath, Feb 24, 2011.

  1. jmath

    jmath Guest

    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_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. zargon

    zargon Community Moderator Forum Guru

    Likes Received:
    Trophy Points:
    Aurora, CO
    Without knowing how each environment is set (more information than just the two NLS variables) no one can say. Post far more information about these environments (operating system, environment, server vendor (HP, Sun, Dell, ...)) so we all will have a better idea of what might be happening.
  3. rajavu

    rajavu Forum Guru

    Likes Received:
    Trophy Points:
    @ Bangalore , India
    In the scenario A and C, $NLS_LANG and $NLS_DATE_FORMAT environment variables are not set. But process works fine in case A, while it failed in case C. how come? what is the difference between these two?