Oracle 11.2.0.3.0, APEX 4.1.1.00.23.
We need to display the numbers in our application with the format FM999999999990.000and dates with the English format DD-MON-YYYY.
Even if the application language changes (French, Spanish, etc.), we always need this format for numbers (without a space or a comma for a group separator and a period for a decimal separator, i.e. -1254.010) and date (first 3 letters from the English month, i.e. 12-FEB-2012).
Here are the globalization attributes that we use (Application Builder → Application → Change Globalization Attributes):
- Appendix Main language: French (France) (fr)
- Application language derived from: session
- Application Date Format: DD-MON-YYYY
I can’t get it to work as expected ... I still get digits of type -1254,01and date similar 12-FÉVR.-2012to -1254.010and instead 12-FEB-2012. APEX seems to ignore any call to change the session ...
I tried to enter the following code in the PL / SQL Code Initialization attribute "(Application Builder -> Application -> Change Security Attributes), but without any success:
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_NUMERIC_CHARACTERS= ''.,'' ';
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_LANGUAGE = ''AMERICAN'' ';
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_LANGUAGE = ''AMERICAN'' ';
END;
I have a report with the following query to see if the parameters are changing:
SELECT
a1.parameter as "Parameter",
a1.value as "Database value",
a2.value as "Instance value",
a3.value as "Session value"
FROM
nls_database_parameters a1
LEFT JOIN nls_instance_parameters a2 ON a1.parameter = a2.parameter
LEFT JOIN nls_session_parameters a3 ON a1.parameter = a3.parameter
ORDER BY
a1.parameter asc;
Result:

As you can see, challenges ALTER SESSIONdo not change anything ...
ALTER SESSION Before Header, , , ( ), ...
" ", , , ...
- ALTER SESSION PL/SQL-, APEX. "/ ".
: ?
EDIT:
:
BEGIN
APEX_UTIL.SET_SESSION_LANG('fr');
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_NUMERIC_CHARACTERS= ''.,'' ';
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_LANGUAGE = ''AMERICAN'' ';
END;
, :

- .
- , NLS.
- , .
- "SQL Query" .
- Number "SQL Query" .
- , JQuery, , PL/SQL,
htp.prn() , . - , JQuery, ( ..) .
, , . "" - .
"getDate", ajax, ! "" (invalid date).
- , JavaScript ( ajax- Application Demand, PL/SQL ) ?
, , , Before Header. , , "" , .
, .