How to execute EXTRACT( HOUR.. in version 10.2.0.1.0 ?
602857Jan 21 2009 — edited Jan 22 2009Hi colleagues!!
I am using the oracle version 10.2.0.1.0 and I found that there is a function called EXTRACT
This function works good when I execute the year, month and day, but in minute, second and hour doesn't work. This display the error
ORA-30076: invalid extract field for extract source.
Is neccesary make execute some query to be available this function in this version?
SELECT EXTRACT( HOUR FROM DATE_VARIABLE ) FROM DUAL;
For questions of performance I don't want to use TO_CHAR function. Is it right?
SELECT TO_CHAR( DATE_VARIABLE, 'HH' ) FROM DUAL;
I think is better the function EXTRACT because it returns number and the TO_CHAR function returns a VARCHAR
Any Help will be very appreciated
Thanks in advance
Best Regards