I've having a problem where I keep getting this error:
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 128
...when I run my .sql through a UNIX .sh script.
charcreatedate and charmoddate are both varchar2(10). If I use charcreatedate in the WHERE clause, the script runs fine. But if I run it with charmoddate, it produces the error. Any ideas as to the problem?
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 128
...when I run my .sql through a UNIX .sh script.
charcreatedate and charmoddate are both varchar2(10). If I use charcreatedate in the WHERE clause, the script runs fine. But if I run it with charmoddate, it produces the error. Any ideas as to the problem?
Code:
declare
cursor c1 is
select
merchantname,
charcreatedate,
charmoddate
from tbl1
where charmoddate = TO_CHAR(SYSDATE,'YYYY-MM-DD');
F1 tbl1.merchantname%TYPE;
F2 tbl1.charcreatedate%TYPE;
F3 tbl1.charmoddate%TYPE;
BEGIN UTL_FILE portion...