PLW-07204 Warning

Advertisement
We are using SQLDeveloper and almost every stored procedure I compile I get this warning. If I had it my way, I would not use SQLDeveloper but due to budget restrictions this is all I have.
Here is the piece of code I am getting this warning on.
select count(*)
into dup_cnt
FROM trans
WHERE trans.ID_SSN = SSN_NUM
AND trans_cd = 'DU'
and trans_date between '01-NOV-'||to_char(to_number(to_char(sysdate,'YYYY')-1)) and trunc(sysdate);
Thank you for taking time to look at this.
Sandeep.
Advertisement

Replay

I don't get any errors compiling it (in SQL*Plus or
SQLDeveloper) these are only warnings, but would like
not to get any warnings.did you get any warning message when you tried to recompile it in SQL*Plus?
i think it might have been because your start range is ahead of end range. if your 01-NOV is always fixed you need to define some mechanism that would allow your code to use the current year or prior year if the current month is not yet in november or ahead of november which is in december.
  decode(to_char(sysdate,'MON'),'NOV', to_date('01-NOV-'||to_char(sysdate,'YYYY'),'DD-MON-YYYY'),
                                'DEC','to_date('01-NOV-'||to_char(sysdate,'YYYY'),'DD-MON-YYYY'),
                                to_date('01-NOV-'||to_char(to_number(to_char(sysdate,'YYYY'))-1),'DD-MON-YYYY'))