2012-10-04 42 views

Respuesta

13

Insertar:

insert into tablename (LASTTOUCH) values (CURRENT_TIMESTAMP); 

Actualización:

update tablename set LASTTOUCH=CURRENT_TIMESTAMP; 
6

Si desea que la hora actual (incluyendo la precisión marca de tiempo), se puede usar ya sea systimestamp o CURRENT_TIMESTAMP

SQL> select systimestamp from dual; 

SYSTIMESTAMP 
--------------------------------------------------------------------------- 
04-OCT-12 11.39.37.670428 AM -04:00 

SQL> select CURRENT_TIMESTAMP from dual; 

CURRENT_TIMESTAMP 
--------------------------------------------------------------------------- 
04-OCT-12 11.39.51.021937 AM -04:00 

update table_name set column_name = SYSTIMESTAMP where id = 100; 

Si usted acaba de establecer el valor en sysdate, la parte de los segundos fraccionarios de la marca de tiempo se pone a cero como dat e se convierte implícitamente en marca de tiempo.

SQL> create table t1(
    2  time1 timestamp 
    3 ); 

Table created. 

SQL> insert into t1 values (sysdate); 

1 row created. 

SQL> commit; 

SQL> select to_char(time1,'MM/DD/YYYY HH24:MI:SS.FF6') result from t1; 

RESULT 
----------------------------- 
10/04/2012 11:43:07.000000 
0
INSERT INTO tableName VALUES (SYSDATE); 

O

UPDATE tableName SET COLUMN = SYSDATE; 
Cuestiones relacionadas