Issue while creating a seq file :: ORA-06502: PL/SQL: numeric or value error: character to
I'M facing an issue like, one time the file is creating fine with same logic ...eg: PIPC12000001.txt
but next time I'M using the same logic then it's giving the above error and also sometimes it is creating like this way PIDOH121.txt. even i have converted into to_number() but it's still giving the above error. I need file name like PIDOH12000001.txt , PIDOH12000002.txt ......etc,
NOTE: datafile_name column size is VARCHAR2(20).
DECLARE
v_seq NUMBER;
v_filecount NUMBER;
v_y1 VARCHAR2 (10):=TO_CHAR(SYSDATE,'YY');
v_y2 VARCHAR2 (10); v_datafile_name VARCHAR2 (200);
BEGIN
BEGIN
SELECT count(*)