To alter group separator of decimal number in oracle I use
ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '.,';
But ALTER SESSION means that this will for only for current connection. I’ve tried only SET NLS_NUMERIC_CHARACTERS = '.,'; but got no effect and ALTER SYSTEM also didn’t work
So the question is: how to set NLS_NUMERIC_CHARACTERS for every session?
Thanks.
The best approach probably depends on how you’re inserting your data – whether through SQL*Plus insert statements, SQL*Loader, external tables, or something else.
If you are working in SQL*Plus then you can issue the
alter sessioncommand automatically on login, for yourself only with a user profile, or with a site profile.If you’re doing lots of individual insert statements and are using
to_numberalready, then there’s a third parameter for that which lets you set NLS parameters on a per-command basis. That sounds like a painful way to do ‘insert a lot data’ though, and amending existing statements might not be too much fun as you’d have to also add the format mask, if there isn’t one present.Alternatively, you can set NLS parameters in your environment; e.g. you can set an NLS_LANG that has the
NLS_NUMERIC_CHARACTERSsetting you want. This is probably preferable overall, and will apply if you’re using SQL*Loader to load your data; though I suspect you aren’t, and you could useto_numberin the control file anyway.Some clients have other ways of setting that; SQL Developer has a Database->NLS section in its preferences, for example.
Lots more on NLS stuff here.