Re: help needed with query
Re: help needed with query
- Subject: Re: help needed with query
- From: Theodore Petrosky <email@hidden>
- Date: Mon, 4 Feb 2008 06:32:07 -0800 (PST)
I was hoping there was a way in WO to create an
EOFetchSpecification that would do the query. I don't
want to write the query.
This is my first attempt at working with related
tables and I am lost.
Ted
--- Daniele Corti <email@hidden> wrote:
> 2008/2/4, Theodore Petrosky <email@hidden>:
> >
> > First, most of my experience is with cocoa. I
> could
> > write any query I wanted even across
> relationships. I
> > am having a problem with relationship in WO.
> >
> > I am starting out with a new simple setup. My db
> is
> > normalized like this
> >
> > table names:
> > firstname text
> > lastname text
> > nameid (serial)
> >
> > namesbusinessmeta:
> > iscurrent bool default true
> > phonenumber text
> > extension text
> > nbmid
> > namesFKid foreign key to names
> >
> > I have a trigger and function on the db that
> creates a
> > new insert into namesbusinessmeta with the
> referenced
> > foreign key on insert into the names table.
> >
> > This works fine.
> >
> > but now I want to query from my WO app.
> > select * from names where nameid in (select
> namesFKid
> > from namesbusinessmeta where iscurrent = true)
> order
> > by lastname;
> >
> > I am lost.... I want an array of current employees
> > where the iscurrent bool is in relationship
> table.
> >
> > Maybe I am barking up the wrong tree......
>
>
> Wait... how do you make the queries?
> EOKeyValueQualifier?
>
> Anycase, you should have a query like (using sql92),
>
> SELECT * FROM names AS t1, namesbusinessmeta AS t2
> WHERE t1.nameid =
> t2.namesFKid AND t2.iscurrent = TRUE;
>
>
>
> Ted
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Looking for last minute shopping deals?
> > Find them fast with Yahoo! Search.
> >
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> > _______________________________________________
> > 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
> >
>
>
>
> --
> Daniele Corti
> AIM: S0CR4TE5
> Messenger: email@hidden
>
> --
> Computers are like air conditioners -- they stop
> working properly if you
> open
> WINDOWS
>
> --
> What about the four lusers of the apocalypse? I
> nominate:
> "advertising", "can't log in", "power switch" and
> "what backup?"
> --Alistair Young
>
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
_______________________________________________
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