Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Instruction EXTRACT

YimySep 25 2007 — edited Sep 25 2007
Hello,

The instruction EXTRACT have an error:

SELECT SYSDATE, EXTRACT(YEAR FROM SYSDATE) "AÑO",
EXTRACT(MONTH FROM SYSDATE) MES,
EXTRACT(DAY FROM SYSDATE) DIA,
EXTRACT(MINUTE FROM systimestamp) MINUTOS,
EXTRACT(SECOND FROM systimestamp) SEGUNDOS
FROM DUAL;

when you execute the instruction it is succefull, but if you add the next:
SELECT EXTRACT(HOUR FROM systimestamp) HORA FROM DUAL;

you can check that the hour is not correct, but with te traditional to_char : SELECT to_char(systimestamp,'hh24') from dual;
Is succefull.

Thanks for your atention.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2007
Added on Sep 25 2007
4 comments
1,209 views