Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Init parameter NLS_NUMERIC_CHARACTERS ignored

Martin1Jan 12 2007 — edited Jan 15 2007
Hi,

i want to insert number values via the following stored procedure into a table with a column of datatype VARCHAR2.

PROCEDURE testDecimalSign
IS
vNum NUMBER := 12.34;
BEGIN
INSERT INTO testtable(col_a) VALUES (TO_CHAR(vNum));
COMMIT;
END;

The column col_a of the table testtable has the datatype VARCHAR2(100);

First of all i did the following statement and rebooted the database:
ALTER SYSTEM SET NLS_NUMERIC_CHARACTERS = ".," SCOPE = SPFILE;

Now when i query the table there is '12,34' instead of '12.34' inserted.

But:
When i put an alter session first in the procedure, it works fine!?

PROCEDURE testDecimalSign
IS
vNum NUMBER := 12.34;
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ".,"';
INSERT INTO testtable(col_a) VALUES (TO_CHAR(vNum));
END;


Is it possible that the initialization parameter NLS_NUMERIC_CHARACTERS is ignored?

Has somebody an idea of this problem?

Many thanks in advance and best regards
Martin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2007
Added on Jan 12 2007
6 comments
926 views