• 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: CD: Predicate Builder - specifying NULL relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CD: Predicate Builder - specifying NULL relationship


  • Subject: Re: CD: Predicate Builder - specifying NULL relationship
  • From: Fritz Anderson <email@hidden>
  • Date: Thu, 23 Mar 2006 09:13:06 -0600

The favor of a reply would be greatly appreciated.

The summary is that I would like to test for null attributes in a predicate built from the Xcode predicate builder. Simply using attribute == NULL quotes the string ("NULL"), which I believe is not what I want. I have tried the "variable" variant of the rhs, and gotten $#NULL, which I am not sure is what I want.

	-- F

On 20 Mar 2006, at 10:59 PM, Fritz Anderson wrote:

In this question, a Slot relates to one Bank, and to one Entry. The relationships are named bank and entry, respectively. The entry relationship is optional, the bank relationship is not.

I am trying to fetch all Slots that belong to a particular Bank, and have no Entry associated with them. I believe the proper predicate is:

	bank == $BANK AND entry == NULL

with BANK to be supplied later. Assuming this is a sensible thing to do (please tell me, otherwise)...

(1) How does one construct this predicate in Xcode's predicate editor? I've got
bank = [variable] BANK
AND
entry = [constant] NULL


This yields the expression
bank == $BANK AND entry == "NULL"
which is not what I want -- I want to match NULL, not the string "NULL". My understanding of the predicate syntax is that NULL, without quotes, is a constant.


Using [variable] NULL in the second term produces
bank == $BANK AND entry == $#NULL
which I assume is not what I want. Searching the Cocoabuilder archive for $#NULL produces everything with "null" in it, which is unhelpful.


(2) Slots have a property "ordinal," which is Integer16, and optional. Slots in excess of a Bank's capacity (as my happen in an intermediate state while moving slot contents around) don't set ordinal. Am I right in assuming that it is sensible to speak of ordinal's value being NULL in such cases?

(3) If (2) is yes, how can I use the predicate editor to find excess slots that are empty, and can be scavenged? I believe the expression is
bank == $BANK AND entry == NULL AND ordinal == NULL
Attempting to put [constant] NULL in the right-hand side of the third subexpression produces an alert saying the rhs can't be parsed. I'd guess that it's looking for integers only.


Specifying [variable] NULL returns us to problem (1).

[Suppressing complaint that the variable/constant/key setting should not be hidden in a right-click menu, on the assumption that I'm not the first.]

Any guidance would be greatly appreciated.

	-- F

 --
Fritz Anderson -- http://www.manoverboard.org/
Consulting Programmer -- http://resume.manoverboard.org/
Step into Xcode, Now Available -- http://six.manoverboard.org/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40manoverboard.org


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: CD: Predicate Builder - specifying NULL relationship
      • From: Ashley Clark <email@hidden>
References: 
 >CD: Predicate Builder - specifying NULL relationship (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Sending mail
  • Next by Date: Re: CORE DATA: open last used document ??
  • Previous by thread: CD: Predicate Builder - specifying NULL relationship
  • Next by thread: Re: CD: Predicate Builder - specifying NULL relationship
  • Index(es):
    • Date
    • Thread