Conversion error in oracle

Asked

Viewed 411 times

0

I have a problem: when I run a function no problem occurs but when running in the php, this error occurs:

ORA-06502: PL/SQL: Numeric or value error: Character to number Conversion error

the problem is in these if

IF TO_NUMBER (REPLACE(SUBSTR(VAR_STRCALCULO, 71,15), '.', ',')

Most likely some null value is coming or something that is not possible to convert. How to treat this? because no error occurs in the database and in the application yes?

  • 1

    well the error has no secret, the string extracted from the variable VAR_STRCALCULO is returning something that is not numerical. It is necessary to see what differentiates in the filling of this variable by calling direct bank and by its application, probably parameters ... If there are no differences, you can do a test by output (dbms_output) the variable or write to a temporary table to see what’s coming to it.

  • took the replace and error of application

  • The possible problem would be its separator pattern, which is configured in the NLS_NUMERIC_CHARACTERS session option. In your application you should change this option using . as tab (which is the default normally)

  • yes can be, I will treat replace in the application. Thank you

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.