• 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: SELECT COUNT
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: When do I use addObjectToBothSidesOfRelationshipWithKey?
  • Next by Date: Re: When do I use addObjectToBothSidesOfRelationshipWithKey?
  • Previous by thread: RE: SELECT COUNT
  • Next by thread: Re: SELECT COUNT
  • Index(es):
    • Date
    • Thread