• 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
Re: EOModeler syntax error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOModeler syntax error


  • Subject: Re: EOModeler syntax error
  • From: Kieran Kelleher <email@hidden>
  • Date: Thu, 4 Mar 2004 12:29:16 -0500

There probably is a way .... but I think bad idea to mess with the EOF SQL generator! ..... and bad idea to continue using a reserved word as a table name too :-)

For more information on naming conventions and other reserved words pitfalls see this URL:
http://homepage.mac.com/kelleherk/iblog/C711669388/E1751512668/ index.html


Regards, Kieran


________________________________________________________________
Config = OS X 10.3.2 / Java 1.4.1 / WO 5.2.2 / MySQL 4.0.18 / Connector-J 3.0.11
Blog: http://webobjects.webhop.org/



On Mar 4, 2004, at 12:03 PM, Ben Schwartz wrote:

Ok, thanks I'm going to try it like that - but is there a way to edit the
SQL syntax - I'd just like to know in general, as in this case just adding a
space would fix the problem.


Thank you,

Ben


On 3/4/04 11:57, "Kieran Kelleher" <email@hidden> wrote:

USER is a reserved word in MySQL (a function actually), so change it to
something else for that table.



________________________________________________________________ Config = OS X 10.3.2 / Java 1.4.1 / WO 5.2.2 / MySQL 4.0.18 / Connector-J 3.0.11 Blog: http://webobjects.webhop.org/


On Mar 4, 2004, at 11:13 AM, Ben Schwartz wrote:

Hi,

I'm new to the WO world and I'm trying out some code generation with
EOModeler.
I created a model of a MySQL table in there, and saved that model - I
then
wanted to start populating that db so I decided to use the "Display
Group
Component" within New Project > Display Group Component in Xcode. It
works
great and makes a page where I should be able to insert new records in
the
DB. Unfortunately when I input a new record and tell it to save to the
db
here is the error message I get:


Error:     com.webobjects.eoaccess.EOGeneralAdaptorException:
EvaluateExpression failed: : Next exception:SQL State:42000 -- error
code:
1064 -- msg: Syntax error or access violation: You have an error in
your SQL
syntax near 'User(pk, password, username) VALUES (1, 'password',
'ben')' at
line 1

The reason why that syntax is wrong is because there is no space
between
"User" and the first "(" . The problem is that the SQL syntax is
generated
by either Xcode or EOModeler - I don't know which one and that's where
I
need help. Is there something I am doing wrong for the syntax to be
wrong
and is there a place where I could manually change it for the syntax
to be
correct?


Thanks very much in advance for your help,

-Ben
_______________________________________________
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.
_______________________________________________
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.


References: 
 >Re: EOModeler syntax error (From: Ben Schwartz <email@hidden>)

  • Prev by Date: Re: Starting out
  • Next by Date: CSS Confusion
  • Previous by thread: Re: EOModeler syntax error
  • Next by thread: Custom link attachments and IE
  • Index(es):
    • Date
    • Thread