qwerty123987
Programmer
At the bottom of this code are tow dbms_output statements. The second one always fails with this error message
"The following error has occurred:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_OUTPUT", line 64
ORA-06512: at line 17"
Does anyone know why the second one would fail?
Thanks
Note - mon_dt7 is a column of char(7) that is always in the format YYYY-MM
declare
test char(10);
cursor csr is
select max(mon_dt7) mon_dt7
from table1
lrt csr%ROWTYPE;
begin
open csr;
fetch csr into lrt;
select max(mon_dt7) into test
from table1
dbms_output.put_line(test);
dbms_output.put_line(lrt.mon_dt7);
end;
"The following error has occurred:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_OUTPUT", line 64
ORA-06512: at line 17"
Does anyone know why the second one would fail?
Thanks
Note - mon_dt7 is a column of char(7) that is always in the format YYYY-MM
declare
test char(10);
cursor csr is
select max(mon_dt7) mon_dt7
from table1
lrt csr%ROWTYPE;
begin
open csr;
fetch csr into lrt;
select max(mon_dt7) into test
from table1
dbms_output.put_line(test);
dbms_output.put_line(lrt.mon_dt7);
end;