Monday, January 12, 2015

Invalid Number error in French Language - NLS_NUMERIC_CHARACTERS

In general , for the amounts columns in english we will use ',' as separator and '.' as digit.But in french ',' will be used as a digit.So while multiplying this value with any other value, it will give invalid number error.

To overcome this we need to make the separator as ',' and digit as '.' using the below command.

select TO_NUMBER('99999,33' , '999999999.99' , 'NLS_NUMERIC_CHARACTERS=",."') from dual

To test the above scenario, you need to set the nls_language and nls_territory at the sql developer.

alter session set nls_language='CANDIAN FRENCH';
alter session set nls_territory='CANADA';