Re: SELECT COUNT
Re: SELECT COUNT
- Subject: Re: SELECT COUNT
- From: Justin Tocci <email@hidden>
- Date: Fri, 3 Sep 2004 11:14:52 -0500
If it were my problem, I think my solution would've been more along the
lines of creating a VIEW:
CREATE VIEW test AS SELECT count(item) from titemmaster WHERE ttype =
'KIT' ;
And adding it to my eomodel as a table. I don't know how to do stored
procedures yet, but I would think this is a candidate for that sort of
solution as well.
justin tocci
Fort Wayne, IN
On Sep 3, 2004, at 10:38 AM, email@hidden
wrote:
Message: 6
To: WebObjects (Group) <email@hidden>
From: Benoit Mangez <email@hidden>
Subject: SELECT COUNT
Date: Fri, 3 Sep 2004 10:58:58 +0200
Hi,
Just a simple question...
I have an huge EOQualifier (build by the user). I would like to perform
a simple SELECT COUNT(*) FROM myEntity WHERE (huge qualifier) without
fetching the corresponding objects.
I can't find a simple way to do this.
I tried to translate the 'huge qualifier' into SQL using the following
code:
EOAdaptor adaptor = EOAdaptor.adaptorWithModel(anEntity.model());
EOSQLExpressionFactory sqlfac = new
EOSQLExpressionFactory(adaptor);
sqlfac.createExpression(anEntity).setUseBindVariables(true);
EOSQLExpression sql =
sqlfac.selectStatementForAttributes(new NSArray(anAttribute), false,
fs, anEntity);
System.out.println("sql:"+sql.statement());
This works fine with FrontBase, but with Oracle: the bindings are
missing in sql.statement().
Any ideas ?
Benoit Mangez
_______________________________________________
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.