Mail merge from MySQL source with LO Base Query

Five years ago, I created a query in an OO database and used that query to populate some documents in Writer. Now I have to do the same thing again with updated data. The only problem is, I don’t remember how to get the source to be the query I set up in Base. Here is the detail.

  1. I have a database set up in MySQL in 3rd normal form
  2. I created some views to select the correct data
  3. I created a query to access the views to retrieve the data
  4. I created a Writer template as my merge document
  5. I defined the query as my source (I cannot remember how I did this step)
  6. I successfully ran the merge

I have tried opening an existing database as a source, but that does not give me access to the LO queries. I have tried connecting to an existing MySQL database, but I have the same problem; no accesss to the LO queries.

Perhaps there is someone out there who can tell me how to accomplish this, i.e., use the query output directly as my merge source.

What OS, what versions of OO and LO ?

Also what version of MySQL server and is it MySQL or MariaDB? Thanks.

Your database must first be registered. From the menu Tools->Options->LibreOffice Base->Databases. Once registered, the query is available from menu View->Data Sources or Ctl-Shift-F4. It doesn’t matter which database you use (embedded, split, MySQL, etc) you should have access once it is registered.

Edit: Can’t understand why you are not seeing them. Here is my Base (connected to MySQL) and a Writer doc showing same queries available in both:

Just to sure of what I believe you are saying - you have a Base file connected to a MySQL DB; the Base file has Queries based upon Views/Tables from the MySQL DB; the Base file is registered with LO. Is this correct? If so that is what is shown in my answer.

I did register the database. Sorry, I left that step out in my post. But I see no queries from my LO registration. If I use either connect to or existing source, I can see the tables in the MySQL database, but what I need to see are the queries I have defined in LO for the database.

Edit: Your screen shot is what helped solve this. I recalled I had the old databases in a different location when I initially did this. I actually moved (copied and deleted after making sure things were okay) the data to the new location. The queries were no longer in the original DB. There for a minute I thought I was losing my mind. Thanks for the help. It might have been a week before I caught the obvious error.