Incorrect query parsing
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
Squirrel incorrectly parses valid sql request which leads to an error
To reproduce:
select TRIM(BOTH '|' FROM '|test|')
Result:
Error: 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 ''' at line 1
SQLState: 42000
ErrorCode: 1064
Error occured in:
select TRIM(BOTH '
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
If you don't have a "FROM TABLE" in your select it won't work in ANSI-Syntax (SQL99).
If I can trust this link:
http://www.oreilly.de/catalog/sqlnutger/chapter/ch04.html
besides your missing table your syntax seems to be OK
I tried the same in DB2 and it worked (Test in 3.1.2).
select TRIM(BOTH '|' FROM '|test|') from sysibm.sysdummy1;
Here same in Oracle:
select TRIM(BOTH '|' FROM '|test|') from dual;
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
cwittmann:
Query below does work in MySQL:
select TRIM(BOTH '1' FROM 'test1')
This means that the problem is not in standards that you mentioned but in the way Squirrel parses the query.
Duplicate of #1845435
Simply open your "MySQL Plugin"-Preferences and replace the "Procedure/Function separator" by something else (e.g. "|||")