Bug 96686 - Insert data in temporary MySQL/MariaDB-Table through GUI impossible
Summary: Insert data in temporary MySQL/MariaDB-Table through GUI impossible
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.4.7.2 release
Hardware: x86-64 (AMD64) All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
 
Reported: 2015-12-23 11:03 UTC by Robert Großkopf
Modified: 2020-10-22 19:51 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2015-12-23 11:03:33 UTC
For filtering data shown in reports I'm using a table named "Filter". I could use such a table without problems in a standalone-DB like the internal HSQLDB. With external server-databases I have to use a temporary table, which is only editable for the special connected user.
So I'm doing the following, here shown without macro:
Tools → SQL
CREATE TEMPORARY TABLE IF NOT EXISTS `Filter` (`ID` TINYINT(1) PRIMARY KEY, `Name` VARCHAR(50));
INSERT INTO `Filter` (`ID`) VALUES(1);
Through GUI I only want to update the content of `Name` and read out this for reports.
There is no possibility to update the content through GUI.
1. Form doesn't know anything about the table `Filter`
2. Query-Editor shows the content of `Filter`: SELECT * FROM `Filter` - but it isn't writable, so also unusable as datasource for the form.

There are only two ways to get an update for the temporary table:
Tools → SQL or a command started with a macro.

Tested this with OpenSUSE 42.1 LEAP 64bit rpm Linux, LO 4.4.7.2 and LO 5.0.4.2, native connection to MySQL and also connection through JDBC-driver.
Comment 1 Alex Thurgood 2015-12-23 16:42:38 UTC
At present temporary tables, such as those available through MySQL, can only be created via the SQL command entry, so they are not directly creatable via the GUI anyway.

However, they are also supposed to be updateable, and I guess the only way that that is currently possible is also via the SQL command.

Useful enhancement request, but if we are going to make them updateable via the UI, wouldn't it be better, for the sake of completeness, to also allow for their creation via the UI (e.g. corresponding entry in the uppermost window pane of the Tables UI ?

I imagine that this would involve a fair amount of work. Still, for me at least, a valid request for enhancement.
Comment 2 mhonline 2020-10-22 15:39:29 UTC
Hello

Within other DBMS this problem is solved by a static one-record-only table, catching the actual needed parameters for making static queries for reports etc. (like puting parameter in "Filter"-table via GUI and let it run). Would be a nice to have.

(or someone creates a macro making sure that the parameter is written always to a static place like the first row/record).

mh
Comment 3 Lionel Elie Mamane 2020-10-22 18:19:14 UTC
Did you try "Refresh tables" after creating the temporary table?
Comment 4 Robert Großkopf 2020-10-22 19:51:20 UTC
(In reply to Lionel Elie Mamane from comment #3)
> Did you try "Refresh tables" after creating the temporary table?

The temporary table doesn't appear with "Refresh tables" using LO 7.0.2.2 and native connection. Same behavior with JDBC connection. 

Both tested on OpenSUSE 15.1 64bit rpm Linux with MariaDB.