Bug #28173 | myODBC generates incorrect SQL syntax when update thru ADO with server cursor | ||
---|---|---|---|
Submitted: | 30 Apr 2007 21:09 | Modified: | 3 May 2007 8:50 |
Reporter: | Weige Wang | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / ODBC | Severity: | S3 (Non-critical) |
Version: | 3.51.14 | OS: | Windows (XP SP2) |
Assigned to: | CPU Architecture: | Any |
[30 Apr 2007 21:09]
Weige Wang
[30 Apr 2007 22:03]
Weige Wang
It looks like that the problem goes away when I removed the semicolon from the SQL string that's in the recordset open statement: tsql="select * from pet" instead of tsql="select * from pet;" SQL in myodbc.sql now looks like follows: select * from pet; UPDATE pet SET species='ct',sex='f' WHERE (name='Fluffy' AND owner='Harold' AND species='cat' AND sex='f' AND birth='1993-02-04' AND death IS NULL ); While before they looked like: select * from pet;; UPDATE `mysqa`..`pet` SET sex='f' WHERE (name='Fluffy' AND owner='Harold' AND species='cat' AND sex='w' AND birth='1993-02-04' AND death IS NULL );
[3 May 2007 8:50]
Tonci Grgin
Hi Weige and thanks for your report. As I see, you have found an error in SQL syntax and problem is solved, right? There are some restrictions / specifics on Cursors regarding MySQL server and MyODBC connector so it'll be good to read them: http://dev.mysql.com/doc/refman/5.0/en/cursor-restrictions.html, especially "Cursors are read-only; you cannot use a cursor to update rows.". and http://dev.mysql.com/doc/refman/5.0/en/myodbc-usagenotes-functionality.html There are also specifics of MS cursor engine, like http://support.microsoft.com/kb/247029 etc...