How to: Import Tables into Base

I downloaded a database and corresponding data dictionary. The Data Dictionary is in a separate csv file. The database downloaded as a zipped file and when unzipped, each table is a separate csv spreadsheet.

Is there a way I can import this ‘easily’ into Base? Or do I need to set up each table separately and manually?

Hello,
.
Not certain you can do anything with the data dictionary csv. With the others, it is one at a time from calc to base. See this post for a bit more information → how to convert a ods spreadsheet to and odb table - #2 by Ratslinger
.
A link to the documentation is there also.

Open LibreOffice.
Select ‘Base Database’.
Database Wizard starts.
Step 1: Connect to an existing database → Choose ‘Text’.
Step 2: Search for the path where all csv-files are.
Choose also 'Comma separated value files (csv).
Change the Row Format, if it must be changed. Could also be changed later.
Step 3: Save the database file where you want.

Now you could see all csv files as tables in a database file. But I won’t work with the original files in this text database. I would create a new (internal) database and copy every table of the text database to the internal database. You have to create a primary-key for every table. Could be the csv-files are delivered with such a field, which has to be unique.

wow! that is GREAT!

now, I have a question - why do you say you won’t work with the original files in this text database?

Have a look at the database. Queries are limited to only one table and no functions are available. It would be much better to use one of the internal databases for testing. There you could connect tables, could create queries for more than one table and have a lot of functions available.

The data are all there in a database for text tables. But if you want a little bit more than only searching through one table its better to copy all the tables in a relational database.

1 Like

I created another database in Base, with all of the table structures, and now I’m trying to figure out how to get the data from the tables in the first database (created the way you advised, from the csv spreadsheets) into the new database. I tried to open one of the tables, select all, copy, and then went to the new database, but I couldn’t paste the data in.

I thought maybe I could create a query to grab the data, but couldn’t figure out how to do that, either.

I’m a little frustrated. I’ve used MS Access for years, but this just doesn’t really work the same way. I tried using the Help, but it wasn’t very helpful.

Quick and dirty, if you already defined the tables:
Copy from first database,
Paste in Calc
mark everything in Calc and copy again,
from the list of tables, choose the desired table and from context menu (right mouse button) choose paste,
An import dialogue should guide you further.

But this you could also have done via loading the csv directly in Calc.

Tables should not be opened. Following actions only on icons:
Right mouse click on the table in the text database → copy
Right mouse click on the table in new HSQLDB database → insert
A wizard appears. You have to append data to the new table. Hope you have created a field for the primary key.
See: Chapter 3 Tables