Re: From OpenBase To MSSQLServer2000 (EOModeller)
Re: From OpenBase To MSSQLServer2000 (EOModeller)
- Subject: Re: From OpenBase To MSSQLServer2000 (EOModeller)
- From: Ricardo Strausz <email@hidden>
- Date: Wed, 4 Jun 2003 13:35:13 -0500
On miircoles, juni 4, 2003, at 04:00 America/Mexico_City, Art Isbell
wrote:
On Tuesday, June 3, 2003, at 07:49 PM, Jonathan Fleming wrote:
Anyhow, i have now followed your suggestion and, of course, it worked
as you though it would, thus your frustration with me... sorry about
that. But now the result is giving me the same answer for every row
and the count is more than what each row should contain as a count
and also the count is a larger number than the true amount of records
in the DB.
This is what I have now used:
(SELECT COUNT(*) FROM TB_JOB, TB_JOB_PICTURE WHERE
TB_JOB_PICTURE.TB_JOB_ID = TB_JOB.TB_JOB_ID)
It makes sense that the count is the same for every row because the
derived SQL is identical for every row. In making my prior
suggestion, I was concentrating on your error message rather than on
what you were trying to do.
What you actually need is something like:
SELECT COUNT(*) FROM TB_JOB_PICTURE WHERE TB_JOB_PICTURE.TB_JOB_ID =
<TB_JOB_ID value for the current TB_JOB row>
I don't recall ever using such a derived attribute, so I'm not sure
what EOF-specific (i.e., non-SQL) syntax might be substituted for the
value of the current row's primary key. Now I wonder whether such a
derived attribute is supported by EOF.
As far as I remember, EOF DO support such derived atributes; they have
to be flatened in EOModeler. But as far as I remember they slow down
the fetch.
I suppose you could define a stored procedure instead if you didn't
want to fetch the related objects in order to count them on the > client.
Aloha,
Art
_______________________________________________
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.