Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / SQL Data Types
 

Insert data to timestamp with time zone type column

SQL>  create table myTable (   2  starts  timestamp with time zone ); Table created. SQL> SQL> insert into myTable (starts)   2  values (TIMESTAMP '2001-12-01 15:00:00.000000 EST'); 1 row created. SQL> SQL> insert into myTable (starts)   2  values (TIMESTAMP '2001-12-01 17:00:00.000000 PST'); 1 row created. SQL> SQL> insert into myTable (starts)   2  values (TIMESTAMP '2001-12-01 20:00:00.000000 GMT'); 1 row created. SQL> SQL> select dbtimezone from dual; DBTIME ------ +00:00 SQL> select *   2  from myTable   3  where starts = TIMESTAMP '2001-12-01 15:00:00.000000 -5:00'; STARTS ------------------------------ 01-DEC-01 03.00.00.000000 PM E ST 01-DEC-01 08.00.00.000000 PM G MT SQL> drop table myTable; Table dropped. SQL>