Cannot Set Column Default Value
Posted: Wed Jan 06, 2010 2:33 am
Hi all. I have tried to find an answer to this in the forums in vain so I am posting this to see whether anyone else has experienced the same problem.
I am reading through Andrew Pitonyak's AndrewBase document (http://www.pitonyak.org/database/) and tried his example creating DEALER and ITEMS tables (around page 24). The tables are very simple:
Following the document, I want to set a default value of 0 (zero) for the DEALER column in the ITEM table. Base seems to accept it in the Table Design screen. But something goes wrong when establishing a relationship between the tables (Tools | Relationships...). I can create the link between the tables (ID in the DEALER table and DEALER in the ITEM table). When I edit the link to set Update Options to Update Cascade and Delete Options to Set Default, I get and error message saying:
Clicking OK deletes the relationship between the tables.
If I then go back to edit the table in the Table Design screen I find the default value is no longer there.
I am reading through Andrew Pitonyak's AndrewBase document (http://www.pitonyak.org/database/) and tried his example creating DEALER and ITEMS tables (around page 24). The tables are very simple:
Code: Select all
DEALER table
Field Field Type Comment
ID Integer [INTEGER] Table's primary key
NAME Text [VARCHAR] Dealer name.
ITEM Table
Field Field Type Comment
ID Integer [INTEGER] Table's primary key
NAME Text [VARCHAR] Item name.
DEALER Integer [INTEGER] Dealer ID.
missing DEFAULT value on column DEALER in statement [ALTER TABLE "ITEM" ADD FOREIGN KEY ("DEALER") REFERENCES "DEALER" ("ID") ON UPDATE CASCADE ON DELETE SET DEFAULT]
Clicking OK deletes the relationship between the tables.
If I then go back to edit the table in the Table Design screen I find the default value is no longer there.