Bug 89523 - EDITING: Formdesign: Push-Buttons should get a possibility to execute direct SQL-code
Summary: EDITING: Formdesign: Push-Buttons should get a possibility to execute direct ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Base-UX
  Show dependency treegraph
 
Reported: 2015-02-21 08:34 UTC by Robert Großkopf
Modified: 2017-07-01 06:57 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Show where to integrate the SQL-Code in general properties of a push-button. (206.92 KB, image/jpeg)
2015-02-21 08:34 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2015-02-21 08:34:48 UTC
Created attachment 113570 [details]
Show where to integrate the SQL-Code in general properties of a push-button.

For many little SQL-tasks in LO-Base you need to execute a macro. It would be a good enhancement to get this possibility directly in a push-button without any knowledge of tricky macros.

Examples

1) Many people use separate filter-tables to search for the right data in subforms. The fields in the tables should be set to NULL for showing all data. You could delete the content in every field, save the form and refresh the other form. Better you will set 
UPDATE "Filter" SET "F_1" = NULL;
UPDATE "Filter" SET "F_2" = NULL;
UPDATE "Filter" SET "F_3" = NULL;
UPDATE "Filter" SET "F_4" = NULL
and refresh the other form - all by pressing one push-button.

2) All content of a table, which is older than 100 days, should be deleted:
DELETE FROM TABLE "TABLE1" WHERE DATEDIFF ('dd', DATUM,CURRENT_DATE) > 100
You could add the code every time directly to Tools → SQL and have to remember every time. You could add this code to a macro. Or you would add this code to a push-button and it would be executed there.

It would be great to get a possibility to save SQL-code in a button and to execute this code if it is needed.
There should be added a field for SQL-native and also an Action "Execute SQL → Refresh Form".
Comment 1 F3K Total 2015-02-21 09:02:11 UTC
This feature would be a great improvement
Another example would be
INSERT INTO TABLE1 (V1,V2,V3)(SELECT F1,F2,F3 FROM TABLE_DEFAULTS WHERE ID = 0) to set pre-adjustable default values into a new record.