naveen.kuruguntla
naveen.kuruguntla

Reputation: 1

How to insert current system date in oracle not the database date?

I am trying to insert my system date by using the query is,"insert into table values (current_date)",But it is inserting database date, Help me to solve this problem

Upvotes: 0

Views: 315

Answers (1)

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59503

CURRENT_DATE returns the date/time in your current session time zone. Most likely you did not set the session time zone and Oracle defaults it to database time zone.

You can set your session time zone explicitly by

ALTER SESSION SET TIME_ZONE = ...

Default SESSIONTIMEZONE can be set by environment variable ORA_SDTZ or (on Windows) by registry entry HKLM\SOFTWARE\Wow6432Node\ORACLE\KEY_%ORACLE_HOME_NAME%\ORA_SDTZ (for 32 bit Client), resp. HKLM\SOFTWARE\ORACLE\KEY_%ORACLE_HOME_NAME%\ORA_SDTZ (for 64 bit Client).

Upvotes: 1

Related Questions