Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to change the default value of field in base?

I am trying using SQL to set the default date for a new record in DATEFIELD in my database in LibreOffice Base at the in the sql command window. All efforts have failed so far:

I have tried this command 1: ALTER TABLE "MYTABLE" ALTER COLUMN "DATEFIELD" SET "DATEFIELD"= 2016-12-31

I am getting this result

1: Unexpected token: DATEFIELD in statement [ALTER TABLE "DATEFIELD" ALTER COLUMN "DATEFIELD" SET "DATEFIELD"]

Then I tried:

ALTER TABLE "MYTABLE" ALTER COLUMN "DATEFIELD" SET = 2016-12-31

2: Unexpected token: = in statement [ALTER TABLE "DATEFIELD" ALTER COLUMN "DATEFIELD" SET =]


That is just a random date, it could be the current date also.