Le 31/05/12 19:21, Andreas Säger a écrit :

Hi Andreas,


> 
> menu:Tools>SQL...
> ALTER TABLE "table name" ALTER COLUMN "column name" SET DEFAULT
> CURRENT_DATE

I just tried that, and what do you know, it didn't work :

With an existing hsqldb db Table containing :
ID int autoincrement=YES
numseq int(10)
desseq CHAR(100)
PRIMARY KEY = ID

I filled the table with a few records, save, quit, restart, reload.


I then added a date field called dtchg (defined as DATE not DATE/TIME).
I left made this field non-nullable, then saved the table definition,
quit the app, restarted.

Opened ODB file, went to Tools  SQL and entered the command you indicated :

Command executed successfully. OK, I thought, lets try it out.

Opened the table for data entry, nothing in the date field, fair enough,
I didn't ask it to update the previous entries.

Tried entering a new tuple. Tab between fields, when I get to the last
field, i.e. the dtchg field, I leave blank and press Tab. Error !!
Non-nullable field.

"Attempt to insert null into a non-nullable column: column: ID table:
seq3 in statement [INSERT INTO "seq3" ( "numseq","typeseq") VALUES ( ?,?)]"

OK, I thought, it can't handle automatically filling the dtchg field
with what is supposed to be an automatically provided entry. Abandon the
changes, and close the table.

So, I re-edit my table properties and try to turn the field into
something which can be NULL, save the definition, save the db, quit,
restart, reload.

Tried entering a new tuple, tabbing between fields. Get to the dtchg
field : Error !!! Same bloody message. So for some reason the change
from non-nullable to nullable wasn't registered.

Go figure. If I do this with mysql (via non Base tools, eg. CLI or
phpmyadmin), it works.


Alex







-- 
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to