I have a local variable that I need to pass to my for..loop statement:
extract_date Date := sysdate-1;
strMonth char(3):= to_char(extract_date, 'MON');
for rec in (select unit,decode(account,800,strMonth,0) from tbl)
Loop...
end loop;
I'm getting an error message when I pass the strMonth to the statement.
I tried this one:
strSQL = 'select unit,decode(account,800,'||strMonth||',0) from tbl';
for rec in (strSQL)
Loop...
End Loop;
with no luck.
Any help will be greatly appreciated.
extract_date Date := sysdate-1;
strMonth char(3):= to_char(extract_date, 'MON');
for rec in (select unit,decode(account,800,strMonth,0) from tbl)
Loop...
end loop;
I'm getting an error message when I pass the strMonth to the statement.
I tried this one:
strSQL = 'select unit,decode(account,800,'||strMonth||',0) from tbl';
for rec in (strSQL)
Loop...
End Loop;
with no luck.
Any help will be greatly appreciated.