Bug 103333 - Give better explanation of how the direct-sql-switch/button works
Summary: Give better explanation of how the direct-sql-switch/button works
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.1.5.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-19 13:20 UTC by libreoffice
Modified: 2016-10-20 18:20 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
SQL-Button on the right is only decoration (1.80 KB, image/gif)
2016-10-19 13:20 UTC, libreoffice
Details

Note You need to log in before you can comment on or make changes to this bug.
Description libreoffice 2016-10-19 13:20:50 UTC
Created attachment 128070 [details]
SQL-Button on the right is only decoration

Clicking the SQL-direct-Command-Button has no effect. No Warning, no dialog, no executed sql-string.
SQL-direct-command is not available anymore.
Comment 1 Robert Großkopf 2016-10-19 14:07:59 UTC
Opened a query, pressed the button, could execute the query - worked.

What warning should appear there? Direct-SQL-execution in query only says: I will send the code directly to the database and wouldn't control is through my internal program. I will present the output of the query at this place.

Could it be you confuse it with 
Tools > SQL
where you could input all SQL-commands, not only queries?

Tested here with OpenSUSE 42.1 64bit rpm Linux, LO 5.1.5.2 and LO 5.2.2.2
Comment 2 libreoffice 2016-10-19 14:26:07 UTC
Thank you for your comment, yes I was searching for Tools > SQL, but in an open query it would not show. 
I found it after going back to the database window.

BUT: No result is shown when I write a simple sql-statement and have it handled by this mysterious SQL-Button. While clicking the execute-query-button gives the expected result.
 No "output of the query at this place" is presented.
Comment 3 Robert Großkopf 2016-10-19 15:51:43 UTC
(In reply to libreoffice from comment #2)
> BUT: No result is shown when I write a simple sql-statement and have it
> handled by this mysterious SQL-Button. While clicking the
> execute-query-button gives the expected result.
>  No "output of the query at this place" is presented.

This SQL-button is a special button for executing a command directly to the database, not controlled by Base. There are some commands that wouldn't work, if the button isn't pressed. 
USER() 
or 
CASE v1 WHEN v2 THEN v3 [ELSE v4] END
for example doesn't work in GUI, but work with the internal HSQLDB and direct SQL.

If you use the SQL-button you could save a query with SQL-comments. You could also format a query by returns.

If you have pressed the SQL-button there is one disadvantage: You couldn't add or change data in a executed query. So direct SQL isn't usable for forms to input new data, because this function must be controlled by Base.

Should we set this bug to Resolved and Worksforme?
Comment 4 libreoffice 2016-10-20 15:34:00 UTC
Thank you again for your comment.
If I understand it right the direct-sql-button is an option switch. Clicking on it switches between two options of how a sql-statement is processed. Comparable to the show-line-breaks-switch in the writer module, that switches between two modes. 
The action of processing the sql-statement is still to be triggered by the excute-query-button.
My suggestion is to explain this functionality in the according help section.
What do you mean by "Should we set this bug to Resolved and Worksforme?"?
Comment 5 Robert Großkopf 2016-10-20 16:16:46 UTC
(In reply to libreoffice from comment #4)

> My suggestion is to explain this functionality in the according help section.

If you are moving the mouse over the button the direct help shows "Execute SQL-Command directly" (or something like this, haven't opened English GUI yet). Look for this direct help in the help of LO. There will be described the same I described here.

This behavior is planned so. It works as described here and in the help. So this isn't a bug. It could be an enhancement-request. But what enhancement do you expect?

> What do you mean by "Should we set this bug to Resolved and Worksforme?"?

Status of this bug is "Unconfirmed". The direct-SQL-button has an effect when you execute the query. So nobody would confirm there is a bug. 

The only possibility to close this bug (and open a better for an enhancement-request) is to set the status as "Resolved" and then as "Worksforme", because nobody has fixed anything for this bug.