• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
EO & MySQL tedious error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EO & MySQL tedious error


  • Subject: EO & MySQL tedious error
  • From: Fabrice Truillot <email@hidden>
  • Date: Wed, 10 Sep 2003 11:44:18 +0200

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 ケイ素の人 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.

  • Follow-Ups:
    • Re: EO & MySQL tedious error
      • From: Ricardo Strausz <email@hidden>
    • Re: EO & MySQL tedious error
      • From: Jonathan Rochkind <email@hidden>
  • Prev by Date: Re: Database Connection Errors
  • Next by Date: Re: Database Connection Errors
  • Previous by thread: Re: can a WODisplayGroup use a subclass of an entity?
  • Next by thread: Re: EO & MySQL tedious error
  • Index(es):
    • Date
    • Thread