Skip to Main Content

SQL Developer

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!

alter session set nls_date_format="yyyy-mm-dd hh24:mi:ss

745846Jan 12 2010 — edited Jan 12 2010
I want to insert and query the Date values in"yyyy-mm-dd hh24:mm:ss" format.
I can not use to_date function.
So, i created a trigger in my DB script as follows,

CREATE OR REPLACE TRIGGER DATE_TRIG
AFTER LOGON ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'alter session set nls_date_format="yyyy-mm-dd hh24:mi:ss"';
END;

After restarted the oracle instance ,
select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
NLS_DATE_FORMAT yyyy-mm-dd hh24:mi:ss

But when i check the date column the value was inserted as"2010-01-12". There is no hour minute second value.
Why is that?

I have to insert hour min sec also. Where i did wrong ?
can somebody help me? I need it very urgent?
Thanks.
-viji

Edited by: user12437966 on Jan 12, 2010 1:12 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2010
Added on Jan 12 2010
5 comments
195,368 views