Run queries in macro in mariadb connected odb file

I connected an odb file to mariadb server via ODBC.
Works great.
now I need to run some action queries via macro.
When I create a query in designview the following SQL is created:

SELECT ID, img_blob FROM table.lnk_img AS lnk_img

Query works fine, but when I want to run the SELECT statement in Tools > SQL… Base will crash with unexpected error… probable something wrong with syntax I guess.
I also tried this format
SELECT “ID”, “img_blob” FROM “table”." lnk_img" AS “lnk_img” which causes a crash.

how to format SQL statements in a query?

I createrd a new odb file connected with JDBC, using the mysql connecting…
the query is now created like this: SELECT ID, img_blob FROM table.lnk_img AS lnk_img

This also works in Tools > SQL…

In my macro I have to add " to the SQL statement like this:
SELECT “ID”, “img_blob” FROM “table”."lnk_img" AS “lnk_img

Am I correct?

Hello @RobVld,

When using MariaDB or MySQL the fields or table names are surrounded by the back tick and not the quote mark.

SELECT `ID`, `img_blob` FROM `table`.`lnk_img` AS `lnk_img`

This is true in macros also.

Only reserved keywords need to be in backticks. Full explanation at https://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-back-ticks-in-mysql.