Date field handling in PL/SQL 9.0x

kzaleski

Member
One or our users recently moved from PL/SQL Developer 7.x on Windows XP to PL/SQL Developer 9.0.6.1665 on Win7. The following query is now generating an error about trade_dt, which is a date field.

select distinct sa.acct_id
from subaccount sa , perf_transaction pt
where pt.subacct_id = sa.subacct_id
and pt.trade_dt >= '01-nov-2012'
and pt.trade_dt
 
what is your date format? See:Tools->Perferences>NLS Options.

There is always a risk comparing date with varchar strings without using to_date. Always use where = to_date(,)
 
Joachim, if the table is small, no problem, as this approach neglects any index on . Actually, things should be done the other way; date parameters should always be converted:
where = to_date(, )

Best regards,
Gustavo
 
Back
Top