ORA-06502: PL/SQL: numeric or value error: character to number conversion error

chalie001
chalie001 used Ask the Experts™
on
hi am geting error in this function ORA-06502: PL/SQL: numeric or value error: character to number conversion error
conversionerror.sql
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
programmer-analyst
Commented:
Of course, because your input parameter is 'AA0727170', so to_number(vsInput) raises error. You have to extract number part of input parameter.

You can use something like this:
select regexp_replace('AA0727170','[^[:digit:]]') from dual;

Author

Commented:
i also what to pass a number in this function like 1254455
Helena Markováprogrammer-analyst

Commented:
You can add input parameter to your function like this:
CREATE OR REPLACE FUNCTION GEN_CURRENT_SIN (vsInput VARCHAR2,x_numInput NUMBER) ...

Author

Commented:
i use he function

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial