Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


SewHelpMe wrote:
This is my first time using LibreOffice Base and in case I'm not very clear
... I haven't programmed anything in almost 15 years so this is a bit of a
transition for an old lady.

I'm creating a table and I want a field to be of type Integer and Not Null.
(Note: I already have another field in the same table that is with the same
configuration, ie Integer/Not Null, and I'm editing an existing table to add
this field.)

I keep getting the error message:

Error while saving the table design
Column constraints are not acceptable in statement [ALTER TABLE "Companion
Subspecies" ADD "Help Type" INTEGER NOT NULL]

Could someone kindly point me in the right direction to correct my problem?

Thank you.

--
View this message in context: http://nabble.documentfoundation.org/Integer-Not-Null-tp3990551.html
Sent from the Users mailing list archive at Nabble.com.

I had to read your email another time to understand what you were saying.
The SQL for altering a table by adding a field is:

ALTER TABLE <tablename> ADD [COLUMN] <columnname> Datatype
[(columnSize[,precision])] [{DEFAULT <defaultValue> |
GENERATED BY DEFAULT AS IDENTITY (START WITH <n>[, INCREMENT BY <m>])}] |
[[NOT] NULL] [IDENTITY] [PRIMARY KEY]
[BEFORE <existingcolumn>];

From what I read, "Companion Subspecies" is the table's name and "Help type" is the field's name. Putting these into the SQL statement:
ALTER TABLE "Companion Subspecies" ADD COLUMN "Help type" INTEGER NOT NULL;

     Looks like you used ADD instead of ADD COLUMN.
I have added an attachment to this email for your personal use: the HSQLDB user guide version 1.8. (This guide is for the version of HSQLDB used by Base.) This should help you refresh your memory.

--Dan



--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.