You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openoffice.apache.org by Girvin Herr <gh...@fastmail.com> on 2022/09/15 19:51:57 UTC

database copying in AOO Base

Greetings,

I am running AOO 4.1.12 under Slackware Linux 14.2 (K4.4.301), with 
Mariadb 10.0.38 and mysql-connector-java 5.1.42.

I have two databases (separate mariadb database files and separate AOO 
.odb files) which I would like to work on and I have two questions about 
that work:

 1. I would like to import the table structure (_Not_ the data), SQL
    queries, data entry forms, and maybe as a bonus, the reports, from
    one of the databases into the other database. Does Base have
    functions to do that (i.e. Ctrl-C / Ctrl-V across database lines) or
    do I need to reinvent the wheel and recreate the structures in the
    destination database?

 2. If and when the above is done: within the same destination database,
    can I merge (i.e. copy-append) data within one table into the new
    database table created in #1 above?

I am pretty sure this can be done in Mariadb (MySql), but I think it 
would be more time-consuming and difficult without a GUI. The answers to 
these two questions will determine my procedure.

Thanks.

Girvin



Re: database copying in AOO Base

Posted by Girvin Herr <gh...@fastmail.com>.
On 9/15/22 8:30 PM, Brian Barker wrote:
> At 12:51 15/09/2022 -0700, you wrote:
>> I would like to import the table structure (_Not_ the data), SQL 
>> queries, data entry forms, and maybe as a bonus, the reports, fromĀ  
>> one of the databases into the other database.
>
> I'm no expert, but how about duplicating the original database and 
> deleting all the data in it?
>
>> If and when the above is done: within the same destination database, 
>> can I merge (i.e. copy-append) data within one table into the new 
>> database table created in #1 above?
>
> As above but don't delete the data in that table?
>
> I trust this helps.
>
> Brian Barker - privately
>
>
Brian et al,

Sorry it took so long to get back to this thread, but I got tied up 
elsewhere.

To make a long story short, I used the procedure in the LO Base 
Handbook, and it worked fine. They used a click, hold and drag operation 
to copy a table from the source database to the destination database. It 
even worked fine for queries, reports, and forms. In short time, I had 
what I wanted. It saved me hours of work. Here is the procedure I used, 
if anyone wants to know:

 1. Open the source database and select "T_a_bles" under "Database" in
    the left pane. Do the same with the destination database.
 2. Click, hold and drag the source database table name in the "Tables"
    pane, to the destination database "Tables" pane. Release the mouse
    button.
 3. In the resulting "Copy" dialog, select "Definition" for only the
    format without the data, or "Definition and data" if the data is
    needed also. Note that in the "Table name" area, the source
    database.table is shown. If so, change it to the destination
    database.table. If this is not done, a "Table exists" error will
    result. (Note to devs: this should be changed!)
 4. Click on "Next". The dialog now allows selection of which fields to
    copy. I wanted all fields, so I chose ">>". Click on Next.
 5. In the resulting dialog, changes to the field formatting can be
    done. I didn't need to do anything there, so I clicked on "Create".
    The table is copied.

I then changed both databases to "_Q_ueries" in the left pane and used 
the click-n-drag method to copy the queries I wanted over to the 
destination database.

I then changed both databases to "For_m_s" in the left pane, and did the 
same for the form I needed to copy.

Needless to say, some tweaking needed to be done. The queries were still 
using the source database names, so they needed editing. I changed the 
table name and the query name, so the query name in the form "data" 
source needed to be changed also. This is done by bringing up the form 
in "Edit" mode and clicking on the "Form" icon on the left when no 
controls are selected. This will bring up the "Form Properties" dialog. 
Select the "Data" tab and edit the "Content" field for the proper data 
source, query or table.

When all that was done, I was able to access the new blank table and I 
am now entering data into it. I have modified the reports in LO, since 
AOO still does not have a reliable report generator yet.

Enjoy!

Girvin