Edit: Note: this is marked as solved, but there is a bug (http://www.openoffice.org/issues/show_bug.cgi?id=114304) that currently prevents SQL from creating Booleans with proper default values. Until that is fixed, you can still use SQL to create the filed directly by you must edit them in the table GUI to set defaults. An important note to this is that any value that is originally set to "No" in the GUI needs to be flipped to "Yes" and back to "No" if that's what you want. Otherwise an error occurs with NULL values. More details in this comment: http://user.services.openoffice.org/en/ ... 16#p155152 |
Using OpenOffice 3.2.1 (Build: 9502) on Mac OSX 10.6.4, I'm trying to create a Boolean field in a table that defaults to "TRUE" via SQL, but it's not working.
Based off of this reference:
http://hsqldb.org/doc/guide/ch09.html#c ... le-section
something like the following should work:
Code: Select all
CREATE TABLE "testTable" ("testBool" BOOLEAN DEFAULT TRUE NOT NULL);
Code: Select all
CREATE TABLE "testTable" (
"pKey" INTEGER NOT NULL IDENTITY PRIMARY KEY,
"test01" BOOLEAN DEFAULT TRUE NOT NULL,
"test02" BOOLEAN DEFAULT True NOT NULL,
"test03" BOOLEAN DEFAULT true NOT NULL,
"test04" BOOLEAN DEFAULT 1 NOT NULL,
"test05" BOOLEAN DEFAULT FALSE NOT NULL,
"test06" BOOLEAN DEFAULT False NOT NULL,
"test07" BOOLEAN DEFAULT false NOT NULL,
"test08" BOOLEAN DEFAULT 0 NOT NULL,
"test09" BOOLEAN DEFAULT TRUE,
"test10" BOOLEAN DEFAULT True,
"test11" BOOLEAN DEFAULT true,
"test12" BOOLEAN DEFAULT 1,
"test13" BOOLEAN DEFAULT FALSE,
"test14" BOOLEAN DEFAULT False,
"test15" BOOLEAN DEFAULT false,
"test16" BOOLEAN DEFAULT 0
);
(NOTE: In order to see the newly create tables you have to you to select View->Refresh Table from the menu bar. If you don't, you won't see the newly created tables after the SQL is run.)
Am I missing something, or is this a bug?