Skip to Main Content

A question about inserting the localTimeStamp returned value into a timestamp with time zone column

dariyooshJan 24 2014 — edited Jan 25 2014

Hello,

Oracle version: Enterprise Edition Release 12.1.0.1.0 - 64bit

OS:                   CentOS 4.6 X86_64

I have a question about the localTimeStamp function. According to the documentation this function does
the same thing as current_TimeStamp except that the returned value doesn't include the time zone.

Consider the following example:

SQL> create table tmptab(colval timestamp with time zone not null);

Table created.

SQL> insert into tmptab(colval) values(localTimeStamp);

1 row created.

SQL> select t1.colval from tmptab t1;

COLVAL

---------------------------------------------------------------------------

24-JAN-14 09.45.42.253732 PM +01:00

SQL>

Why the above insert didn't fail? the data type of the colval column in my table expects a timestamp with time zone

during every inserts which as I understand (correct me if I'm wrong) is not provided by the localTimeStamp function.

Could someone kindly tell me what I misunderstand?

Thanks in advance,

Comments
Post Details
Added on Jan 24 2014
3 comments
162 views