[DBAL-345] When inserting decimals into Oracle, getting ORA-01722: invalid number Created: 04/Sep/12 Updated: 17/Sep/12 Resolved: 17/Sep/12
|Reporter:||Christian Stoller||Assignee:||Benjamin Eberlei|
|Labels:||decimal, number, oracle, separator|
Windows 7 (German), Oracle XE 11.2.0, Doctrine 2.2.2, Symfony 2.0.15
When I insert decimals into database I get the following error message:
Oracle wants decimals (e.g. NUMBER(5,2)) separated by comma instead of a dot. I think the reason is that I use the german version of Windows. I tried to modify the following method of \Doctrine\DBAL\Driver\OCI8\OCI8Statement::bindValue() just for testing of course:
With this modification I do not get the error anymore.
I found some Links that might be interesting regarding this issue:
|Comment by Christian Stoller [ 04/Sep/12 ]|
I found out that the database session has the parameter 'NLS_NUMERIC_CHARACTERS', too.
I get this result:
With doctrine I can get the parameter with this (in Symfony2):
In this case I get this output:
I can change the parameter.
When I execute the above query before I do my insert with decimal values, everything works as expected
|Comment by Benjamin Eberlei [ 05/Sep/12 ]|
There is an Oci8SessionInitListener inside Doctrine DBAL. It does not yet contain the numeric character change. Can you open a pull request on Github DBAL to add this?
|Comment by Christian Stoller [ 13/Sep/12 ]|
|Comment by Benjamin Eberlei [ 17/Sep/12 ]|
A related Github Pull-Request [GH-197] was closed