Re: EO & MySQL tedious error
Re: EO & MySQL tedious error
- Subject: Re: EO & MySQL tedious error
- From: Ricardo Strausz <email@hidden>
- Date: Wed, 10 Sep 2003 11:49:04 -0500
did you try RawSQL??
On miC)rcoles, sept 10, 2003, at 04:44 America/Mexico_City, Fabrice
Truillot wrote:
> Hi all.
>
> Could someone please tell me how to force the EO SQL generator to
> surround the column names by quotes ?
>
>
> - My setup
>
> Entity :
> test_table
> oid: int
> key: varchar
>
> I'm using MySQL 4.0.14, WebObjects 5.2.1 on MacOS X 10.2.6, all on the
> same computer.
>
> - Issue
>
> I got this error :
>
> Error:
> com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression
> failed: : Next exception:SQL State:42000 -- error code: 1064 --
> msg: Syntax error or access violation, message from server: "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 'key =
> 'a')' at line 1"
>
> Reason:
> EvaluateExpression failed:
> <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "DELETE FROM
> test_table WHERE (oid = ? AND key = ?)" withBindings: 1:2(oid),
> 2:"a"(key)>: Next exception:SQL State:42000 -- error code: 1064 --
> msg: Syntax error or access violation, message from server: "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 'key =
> 'b')' at line 1"
>
> MySQL doesn't like this SQL statement :
>
> DELETE FROM test_table WHERE (oid = 2 AND key = 'a')
> ^^^
>
> Actually, I don't have the possibility of renaming the key column. And
> since DELETE FROM test_table WHERE (oid = 2 AND 'key' = 'a') works
> fine...
>
> Any idea ? Thanks !
>
>
> Fabrice Truillot, MiS c1c$g4 c.d::
> www.meninsilicium.com
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.