Convert a Dbase file to a base (hsqldb) table

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
HWJ
Posts: 3
Joined: Mon Apr 21, 2008 6:18 pm

Convert a Dbase file to a base (hsqldb) table

Post by HWJ »

Hi,

I'd like to convert a Dbase file (.dbf) to a table stored in a hsqldb table.
If I just say connect to an existing database, only the information to the path
containing the .dbf file is stored in, say, newdb.odb.
I'd like to get rid of the old .dbf file altogether.

Many thanks for a hint,
Helmut.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Convert a Dbase file to a base (hsqldb) table

Post by Villeroy »

Create a new database from scratch, which will be always a hsqldb. Create a second database linked to a dBase directory and drag the tables from the second into the first. A wizzard pops up... Take care of primary keys. Contrary to dBae, hsql needs PKs to make a table editable.
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
HWJ
Posts: 3
Joined: Mon Apr 21, 2008 6:18 pm

Re: Convert a Dbase file to a base (hsqldb) table

Post by HWJ »

Villeroy wrote:Create a new database from scratch, which will be always a hsqldb. Create a second database linked to a dBase directory and drag the tables from the second into the first. A wizzard pops up...
Take care of primary keys. Contrary to dBae, hsql needs PKs to make a table editable.
Thanks, but sorry, I'm a newbee, how to do that?

I've tried to select an existing field (from the dbase file) but it was rejected saying it has already been selected
as primary key. But if I don't do that table creation fails because of a lacking primary key.
I'm using OO 2.4.0

Thanks for your help,
Helmut.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Convert a Dbase file to a base (hsqldb) table

Post by Villeroy »

If the former dBase table had no suitable candidate for a PK (some ID, unique number) then let the import wizard create a new one by checkíng the option. If there is such a field already, I think the table should be copied even without a primary key. Then open the table in edit mode and declare the respective field as PK (right-click).
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
Post Reply