[Solved] Saving query modified by AOO

Creating tables and queries

[Solved] Saving query modified by AOO

Postby 1gatomontes » Mon Apr 09, 2018 5:24 pm

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!
Last edited by 1gatomontes on Sat Apr 14, 2018 1:26 am, edited 1 time in total.
OpenOffice 4.1.2
Windows 10 (v.1607)
1gatomontes
 
Posts: 20
Joined: Sun May 14, 2017 3:48 am

Re: saving query modified by OO

Postby Sliderule » Mon Apr 09, 2018 5:59 pm

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.
User avatar
Sliderule
Volunteer
 
Posts: 1176
Joined: Thu Nov 29, 2007 9:46 am

[Solved] Saving query modified by AOO

Postby 1gatomontes » Sat Apr 14, 2018 1:22 am

You are right!
Thank you!
OpenOffice 4.1.2
Windows 10 (v.1607)
1gatomontes
 
Posts: 20
Joined: Sun May 14, 2017 3:48 am


Return to Tables & Queries

Who is online

Users browsing this forum: No registered users and 4 guests