Model with Oracle DATE attributes

Hi,

I use Yii with an Oracle database and have an issue with [font=“Courier New”]DATE[/font] columns. By default model’s attributes are assigned values like 01-JAN-12.

What I want is to fetch the exact entire value such as 01-01-2012 23:59:59. I know I can override the query with something like:

[sql]select TO_CHAR(datetime_column, ‘DD-MM-YYYY HH24:MI:SS’)

from …[/sql]

But then I’m unable to use all these fancy automated query generation tricks that come with CActiveRecord.

Is there a way to resolve this to make it inherent to the model?

Thanks!

change oracle default date format by adding:

ALTER SESSION SET NLS_DATE_FORMAT = ‘DD-MM-YYYY HH24:MI:SS’;

as init SQL in your db connection configuration.