Page 1 of 1

[Solved] Saving query modified by AOO

PostPosted: Mon Apr 09, 2018 5:24 pm
by 1gatomontes
Using the "Edit in SQL View", OpenOffice modifies the query when saving it.

For example, I write
SELECT myAttribute from myTable
and test it in the SQL Tool, I get this message:
1: Command successfully executed.

Back to "Edit in SQL View", I save my query, close it, and re-open it in "Edit in SQL View", and now my query looks like this:
SELECT 'myAttribute' from 'myTable'
which gives me this message when I test it in the SQL Tool:
2: 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 ''Benevole'' at line 1

That was not an issue when I was using the OOBase interface with the HSQLDB engine, but I'm now using the MySQL engine, and this single-quote symbols syntax is not supported.

I do I tell OpenOffice not to add these single-quote symbols in the query when saing it?

Thanks!

Re: saving query modified by OO

PostPosted: Mon Apr 09, 2018 5:59 pm
by Sliderule
Single quotes are used to define a text string . . . therefore . . . as you said:
Code: Select all   Expand viewCollapse view
SELECT 'myAttribute' from 'myTable'


you have two text strings defined . . . rather than TABLE or COLUMN names.

In Base Query . . . with MySQL as your Database back-end use either:
  1. ` for example: `myTable`
  2. [] for example: [myTable]
when using a TABLE or COLUMN name.

For example:
  1. Code: Select all   Expand viewCollapse view
    SELECT `myAttribute` from `myTable`

  2. Code: Select all   Expand viewCollapse view
    SELECT [myAttribute] from [myTable]
Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.

[Solved] Saving query modified by AOO

PostPosted: Sat Apr 14, 2018 1:22 am
by 1gatomontes
You are right!
Thank you!