db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark P Ashworth <i...@connext.co.za>
Subject Alter TIMESTAMP field default after creation does not work
Date Fri, 25 Jul 2008 11:38:30 GMT

Good Day,

Derby version: 10.2.2.0

As part of the database data upgrade process I need to do the following so
that the existing rows get a NULL for the column but all new rows will get
the default of the current timestamp.

CREATE TABLE X (
 FIELD INT
)

ALTER TABLE X ADD COLUMN FIELD_DATE TIMESTAMP

ALTER TABLE X ALTER FIELD_DATE DEFAULT CURRENT_TIMESTAMP

Regards,
Mark P Ashworth
-- 
View this message in context: http://www.nabble.com/Alter-TIMESTAMP-field-default-after-creation-does-not-work-tp18650021p18650021.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message