Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/01/2009, 15:51
Pelirr
 
Fecha de Ingreso: diciembre-2008
Mensajes: 233
Antigüedad: 15 años, 4 meses
Puntos: 1
Pregunta Problema al guardar fecha

Hola, hablando de campos timestamp, tengo un problema que no sé como resolver. En mi tabla tengo un campo de este tipo:

CREATE TABLE `accounts` (
`accountnumber` int(11) NOT NULL,
`office` int(11) NOT NULL,
`nif` text NOT NULL,
`creationdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`accounttype` text NOT NULL,
`accountkey` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

hago un insert:

INSERT INTO ACCOUNTS VALUES ('1', '111', '01', 'null', 'cartilla de ahorros', '123');

se supone que no tengo que meterle ningún valor, ya que se actualiza sólo, me debería poner directamente la hora actual. Sin embargo no lo hace, y me dá el siguiente error:

java.sql.SQLException: Incorrect datetime value: 'null' for column 'creationdate' at row 1

¿Podéis echarme un cable? No comprendo que estoy haciendo mal.
Un saludo