[Solved] Listbox multiple column query returns zeros
[Solved] Listbox multiple column query returns zeros
I have followed the instruction viewtopic.php?p=164740#p164740. It worked fine when I had my database as embedded Base file. However, I ported it to an MariaDB SQL server, now using LibreOffice as a frontend. Since then the sintax suggested returns 0 values when the sql is run. What could be the problem? In addition I cannot use double quotes as they are automatically changed to single quotes when I save the statement.
Last edited by Klavs on Wed Jul 26, 2017 1:21 pm, edited 1 time in total.
LibreOffice 5.2.7.2 on Mac OS Sierra
Re: Listbox multiple column query returns zeros
By trial and error and some search I discovered that the syntax with || can be replaced with the following syntax:
etc.
Code: Select all
SELECT CONCAT( [Column1], ' ', [Column2] ), `Column3` FROM
LibreOffice 5.2.7.2 on Mac OS Sierra
-
- Volunteer
- Posts: 1549
- Joined: Wed Jun 24, 2015 12:56 am
- Location: Colorado, USA
Re: Listbox multiple column query returns zeros
Any time you change back-ends it is not unusual to encounter some SQL syntax differences.
While the ANSI standards define the core SQL syntax, each vendor differentiates itself by adding extensions to the standard.
As you discovered not all SQL implementations currently allow double pipes to replace the CONCAT function. It's too bad because 'a' || ' ' || 'b' || ' ' || 'c' is much easier to type and read than the standard CONCAT(CONCAT(CONCAT(CONCAT('a', ' '),'b'), ' '),'c'). MariaDB seems to have extended the CONCAT function because the syntax you used for your solution will fail under HSQL.
In a effort to standardize case sensitivity issues of the underlying operating system HSQL requires any table and table column names containing lower case characters be enclosed in double quotes. It appears MariaDB takes a different approach
https://mariadb.com/kb/en/mariadb/ident ... nsitivity/
While the ANSI standards define the core SQL syntax, each vendor differentiates itself by adding extensions to the standard.
As you discovered not all SQL implementations currently allow double pipes to replace the CONCAT function. It's too bad because 'a' || ' ' || 'b' || ' ' || 'c' is much easier to type and read than the standard CONCAT(CONCAT(CONCAT(CONCAT('a', ' '),'b'), ' '),'c'). MariaDB seems to have extended the CONCAT function because the syntax you used for your solution will fail under HSQL.
In a effort to standardize case sensitivity issues of the underlying operating system HSQL requires any table and table column names containing lower case characters be enclosed in double quotes. It appears MariaDB takes a different approach
https://mariadb.com/kb/en/mariadb/ident ... nsitivity/
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11