Re: EOModeler Generating Bad SQL
Re: EOModeler Generating Bad SQL
- Subject: Re: EOModeler Generating Bad SQL
- From: MadBrowser <email@hidden>
- Date: Tue, 11 Nov 2003 10:34:20 -0800
The query is not producing the correct results.
It gives a NPE when it runs as the bind for the administratorStatus is
null.
On Nov 11, 2003, at 10:27 AM, email@hidden wrote:
Man, like I said, you have not provided enough information to indicate
this is a bug. The fact that the ? mark shows up in the debug trace
just
means that EOF is using bind variables. The next line of the debug
trace
should show you what variable values are being used there.
Does the query return unexpected results? If so, that is a problem,
sure, but you haven't provided enough information to discover what is
causing the problem. Those ? marks in the debug trace are NOT
indicative
of a problem. IF the query is returning the proper results, then you
have
no problem at all.
--Jonathan
On Tue, 11 Nov 2003 08:53:19 -0800 MadBrowser wrote:
I filed this in RADAR as 3480037.
Any idea if there is a workaround?
Begin forwarded message:
From: MadBrowser <email@hidden>
Date: November 11, 2003 8:35:22 AM PST
To: Michael Parlee <email@hidden>
Cc: Apple Webobjects List List <email@hidden>
Subject: Re: EOModeler Generating Bad SQL
Okay... Bad SQL is probably not the correct term... You're right, the
SQL is OK.
It is still not doing what I thought it would, and IIRC, what older
versions did.
The thing that bothers me is that it seems to be using its own
judgment, overriding my desired result.
This looks like a bug to me...
If use the following expression, from the EOModeler docs:
(askingPrice < 10000)
I get:
askingPrice < ?
How can this be correct?
Hunter
On Nov 11, 2003, at 6:20 AM, Michael Parlee wrote:
That is not bad SQL. My understanding is that use of bind variables
is beneficial even for constant values. Constants (or literals)
must
be parsed out of the statement. If you don't use a bind variable
the
statement will require parsing each time it is executed. If a bind
variable is used, the statement is parsed only once
(http://miracleas.dk/tools/Miracle_2_cursor.pdf)
Mike
On Nov 10, 2003, at 11:35 PM, MadBrowser wrote:
EOModeler WO 5.2.2 on Panther 10.3.1.
I have the following qualifier:
((emailAddress = $emailAddress) and (password = $password) and
(administratorStatus = 'yes'))
This generates the following SQL:
SELECT administrator_status, country, editor_status, email_address,
first_name, last_name, password, quality_cost_preference, rec_num,
street_address_1, street_address_2, us_city, us_state, username,
wants_casino_offers, wants_newsletter, year_of_birth, zip_code FROM
user_account WHERE (email_address = ? AND password = ? AND
administrator_status = ?)
Why is it trying to take administratorStatus as a variable when I
am
explicitly requiring that the field contain the value 'yes'?
I have been fiddling with this and can't seem to figure this out.
Am I doing something wrong or is this a bug?
Thanks,
Hunter
_______________________________________________
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.