I am attempting to increment a counter field which is stored as a CHAR(4) using a NUMBER(4) variable and the TO_CHAR function but keep getting a VALUE ERROR exception:
However, using LPAD works just fine:
Does anyone know what's going on here? I'm curious but am probably overlooking something.
Code:
v_detail_line := v_detail_line +1;
CCRR_rec.fee_detail_line_number := TO_CHAR(v_detail_line,'0009');
However, using LPAD works just fine:
Code:
v_detail_line := v_detail_line +1;
CCRR_rec.fee_detail_line_number := LPAD(v_detail_line,4,'0');
Does anyone know what's going on here? I'm curious but am probably overlooking something.