I can successfully import a CSV file into a table. But I would like to make one of the columns in the table contain a boolean field type that is both required and has a default value of false. I've tried doing this in different ways:
* directly, because there is an option for "entry required" in the type formatting dialog
* indirectly, by not selecting the "entry required" option and then attempting to set it afterwards
* adding a column afterwards
None of these approaches work. Is there any way around this?
Thanks.
Importing CSV and required data fields
Importing CSV and required data fields
Open Office 3.5, Linux, Windows & Mac
Re: importing CSV and required data fields
menu:Tools>SQL...
Code: Select all
ALTER TABLE "Your Text Table" ADD COLUMN "B" BOOLEAN DEFAULT FALSE NOT NULL;
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: importing CSV and required data fields
Thanks. I'll look at it because that looks like a useful technique. But this turned out to be pilot error. I was importing a column without any values in it. When I added 0's to the column, it was easy to import the data into the table.
Open Office 3.5, Linux, Windows & Mac
Re: importing CSV and required data fields
Code: Select all
ALTER TABLE "Your Text Table" ADD COLUMN "B" BOOLEAN DEFAULT FALSE;
Code: Select all
UPDATE "Your Text Table" SET "B" = FALSE;
Code: Select all
ALTER TABLE "Your Text Table" ALTER COLUMN "B" SET NOT NULL;
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Importing CSV and required data fields
I was interested to read that you were able to import from a CSV file into Base tables. Could please ask how you are to do this?
OpenOffice 4.1.0 with MacOS 10..4