• 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: Formatter, WORepetition for rawRowsSQL results
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatter, WORepetition for rawRowsSQL results


  • Subject: Re: Formatter, WORepetition for rawRowsSQL results
  • From: David LeBer <email@hidden>
  • Date: Thu, 6 Oct 2005 14:21:31 -0400


On 6-Oct-05, at 2:12 PM, David LeBer wrote:

On 6-Oct-05, at 2:04 PM, Janice Cheung wrote:


    Ken, David,

You may be pleased to note that I am now using the fetch specification ... however,
is there a workaround for the term "SYSDATE" ? It seems my EOModeler doesn't like the
keyword:


    Here is my error returned:

sqlStringForKeyComparisonQualifier: attempt to generate SQL for
com.webobjects.eocontrol.EOKeyComparisonQualifier ($SYSDATE >=
warrantyExpDate) failed because attribute identified by key '$SYSDATE'
was not reachable from from entity 'Server'


although it works at the SQL prompt. I tried to define NSTimestamp as $SYSDATE, but
that did not work either. What should I use?


    Thanks so much for helping me!  I really appreciate it a lot!!


Yay! :-)

Try this:

NSTimestamp now = new NSTimestamp();
NSTimestamp nowPlusSixty = now.timestampByAddingGregorianUnits (0, 0, 60, 0, 0, 0);



Sorry I didn't see that you were trying to model the entire fetch in EOModeler.


Set the dates in your fetch spec to be variables ($now, $later) and pass the values in from your code:

NSTimestamp now = new NSTimestamp();
NSTimestamp nowPlusSixty = now.timestampByAddingGregorianUnits(0, 0, 60, 0, 0, 0);


NSMutableDictionary bindings = new NSMutableDictionary();
bindings.takeValueForKey(now, "now");
bindings.takeVlaueForKey(nowPlusSixty, "later");

NSArray array = EOUtilitiesobjectsWithFetchSpecificationAndBindings(ec,
"entityName",
"fetchSpecName",
bindings);



-- ;david

--
David LeBer
"I am codeferous!"
Codeferous Software
site:   http://www.codeferous.com
blog: http://david.codeferous.com




_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Formatter, WORepetition for rawRowsSQL results (From: Janice Cheung <email@hidden>)
 >Re: Formatter, WORepetition for rawRowsSQL results (From: David LeBer <email@hidden>)
 >Re: Formatter, WORepetition for rawRowsSQL results (From: Janice Cheung <email@hidden>)
 >Re: Formatter, WORepetition for rawRowsSQL results (From: Ken Anderson <email@hidden>)
 >Re: Formatter, WORepetition for rawRowsSQL results (From: Janice Cheung <email@hidden>)
 >Re: Formatter, WORepetition for rawRowsSQL results (From: David LeBer <email@hidden>)

  • Prev by Date: Re: Formatter, WORepetition for rawRowsSQL results
  • Next by Date: invalid credentials
  • Previous by thread: Re: Formatter, WORepetition for rawRowsSQL results
  • Next by thread: Re: Formatter, WORepetition for rawRowsSQL results
  • Index(es):
    • Date
    • Thread