LibreOffice Base MySQL query gives error 1064 in phpMyAdmin

Daniel Kreuter daniel.kreuter85 at googlemail.com
Fri May 20 17:56:40 UTC 2011


Hello,

did you try ' instead of " ? Another thing i find a little bit strange are
the ? in the query, i never used them and i don't know if they are allowed
in mysql or if they even exist in sql???

On Fri, May 20, 2011 at 7:01 PM, Amedee Van Gasse
<amedee-ubuntu at amedee.be>wrote:

> I connected LibreOffice Base (3.3.2) to a local MySQL (5.1.54) database and
> I made a bunch of queries with the query designer.
> When I copy/paste these queries into phpMyAdmin (3.3.10deb1), I get an
> error 1064 (SQL syntax error).
>
> This is an example of a (working) query that I have in LO Base:
>
> SELECT YEAR( "logfiledate" ), MONTH( "logfiledate" ), "Sessions"."UserId",
> "Users"."Name", "Users"."FirstName", "Users"."Cat", SUM(
> "Sessions"."TotalTime" ) FROM "loganalyser"."Sessions" AS "Sessions",
> "loganalyser"."Users" AS "Users", "loganalyser"."Logfiles" AS "Logfiles"
> WHERE "Sessions"."UserId" = "Users"."Trigram" AND "Sessions"."LogFile" =
> "Logfiles"."logfile" AND YEAR( "logfiledate" ) = ? AND MONTH( "logfiledate"
> ) = ? GROUP BY "Sessions"."UserId" ORDER BY SUM( "Sessions"."TotalTime" )
> DESC
>
>
> And this is what phpMyAdmin tells me:
>
> #1064 - You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> '."UserId", "Users"."Name",
> "Users"."FirstName", "Users"."Cat",
> SUM( "Sessions"."' at line 1
> SELECT YEAR(  "logfiledate" ) , MONTH(  "logfiledate" ) ,  "Sessions".
> "UserId",  "Users". "Name",  "Users". "FirstName",  "Users". "Cat", SUM(
>  "Sessions". "TotalTime" )
> FROM  "loganalyser". "Sessions" AS  "Sessions",  "loganalyser". "Users" AS
>  "Users",  "loganalyser". "Logfiles" AS  "Logfiles"
> WHERE  "Sessions". "UserId" =  "Users". "Trigram"
> AND  "Sessions". "LogFile" =  "Logfiles". "logfile"
> AND YEAR(  "logfiledate" ) = ?
> AND MONTH(  "logfiledate" ) = ?
> GROUP BY  "Sessions". "UserId"
> ORDER BY SUM(  "Sessions". "TotalTime" ) DESC
> LIMIT 0 , 30
>
>
> What's the most obvious thing to look at? I've been trying stuff for some
> time now, and I have of course googled error 1064, but I don't see what went
> wrong. One source indicated that I used a reserved word, but I didn't find
> any of these words in my query:
>
> http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-reservedwords.html
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>



-- 
Mit freundlichen Grüßen

Greetings

Daniel Kreuter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20110520/501a9766/attachment.html>


More information about the ubuntu-users mailing list