Uploaded image for project: 'Doctrine DBAL'
  1. Doctrine DBAL
  2. DBAL-345

When inserting decimals into Oracle, getting ORA-01722: invalid number


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3
    • Component/s: None
    • Security Level: All
    • Environment:
      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:

      ORA-01722: invalid number

      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:

          public function bindValue($param, $value, $type = null)
              if (is_float($value)) {
                  $value = str_replace('.', ',', (string) $value); // <--
              return $this->bindParam($param, $value, $type);

      With this modification I do not get the error anymore.
      It would be great if a solution could be found. The strange thing is, if I query "SELECT * from nls_database_parameters where PARAMETER='NLS_NUMERIC_CHARACTERS'" I get ".," which means that a dot is already used as decimal separator. Maybe Oracle preferes the Locale of the OS?!
      Maybe you could provide a setting which defines what separator should be used for decimals.

      I found some Links that might be interesting regarding this issue:



          • Assignee:
            beberlei Benjamin Eberlei
            naitsirch Christian S.
          • Votes:
            0 Vote for this issue
            2 Start watching this issue


            • Created: