Have you ever got message
"ORA-06550: line 3, column 9:
PLS-00307: too many declarations of 'TO_CHAR' match this call
ORA-06550: line 3, column 2:
PL/SQL: SQL Statement ignored" ?
If so, it is the right place for you :). This post will discuss about "How to resolve too many declarations of 'TO_CHAR' match this call" in oracle.
The problem is that your pl/sql is selecting something like '0' and returning a string. The result is that you are attempting to perform a to_char function on a char variable.
we can solve it by either remove the single quotes from the inline view
convert a.foo to a number via the to_number function:
"ORA-06550: line 3, column 9:
PLS-00307: too many declarations of 'TO_CHAR' match this call
ORA-06550: line 3, column 2:
PL/SQL: SQL Statement ignored" ?
If so, it is the right place for you :). This post will discuss about "How to resolve too many declarations of 'TO_CHAR' match this call" in oracle.
The problem is that your pl/sql is selecting something like '0' and returning a string. The result is that you are attempting to perform a to_char function on a char variable.
we can solve it by either remove the single quotes from the inline view
DECLARE
CURSOR c1 IS
SELECT TO_CHAR(NVL(a.foo,'0'),'999')
FROM
(SELECT 0 foo FROM dual) a;
BEGIN
NULL;
END;
orCURSOR c1 IS
SELECT TO_CHAR(NVL(a.foo,'0'),'999')
FROM
(SELECT 0 foo FROM dual) a;
BEGIN
NULL;
END;
convert a.foo to a number via the to_number function:
DECLARE
CURSOR c1 IS
SELECT TO_CHAR(NVL(TO_NUMBER(a.foo),'0'),'999')
FROM
(SELECT '0' foo FROM dual) a;
BEGIN
NULL;
END;
That's all from us, hope this help.
CURSOR c1 IS
SELECT TO_CHAR(NVL(TO_NUMBER(a.foo),'0'),'999')
FROM
(SELECT '0' foo FROM dual) a;
BEGIN
NULL;
END;
No comments:
Post a Comment