Square brackets

Square brackets

am 29.06.2005 20:03:17 von patrick wright

--Apple-Mail-3-27076777
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

I am trying to connect through to the Mysql DB from Oasis Montage
using Mysql ODBC drivers. Whilst Oasis connects to Mysql no problem,
it fails when trying to obtain metadata. This is because it is using
a form of SQL which puts square brackets around the table names.
An example would be "select latitude from [GPGGA]".
I am running Mysql version 4.1.

Mysql comes with two sets of ODBC drivers, I have tried both with the
same failed result. I have checked out the settings and have set them
according to the standard MS products (Access, SQL Server) which also
(used) to send out the square brackets. Access works fine with the
older driver.
No where in the settings do I find any reference to the square brackets.

ODBC drivers are :
MySQL Connector/ODBC 3.51.11-2
and
MySQL Connector/ODBC 2.5

I would appreciate any help on this problem.

By the way this all runs on XP.



--Apple-Mail-3-27076777--

Re: Square brackets

am 30.06.2005 00:19:34 von Daniel Kasak

patrick wright wrote:

> I am trying to connect through to the Mysql DB from Oasis Montage
> using Mysql ODBC drivers. Whilst Oasis connects to Mysql no problem,
> it fails when trying to obtain metadata. This is because it is using
> a form of SQL which puts square brackets around the table names.

I'm pretty sure that this is breaks the SQL standard. Access uses square
brackets when building *local* queries, but when it sends these queries
via ODBC, they are encapsulated in backticks, eg: select `fieldname`
from `tablename`. I don't know why they used square brackets locally ...
possibly to hamper moving your data to another DB server? Anyway, remove
the square brackets. Replace them with backticks if possible. You can
also use single quotes. But better still, don't wrap field / table names
in anything.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak@nusconsulting.com.au
website: http://www.nusconsulting.com.au

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org