Subject RE: [IBO] Grid lookup
Author Dion
Hi Helen,

>KeyLinks:-
> TITLEID=/* QRYMEMBERBEN */BENEFICIARY.TITLEID
Would this not effectively link the Title lookup dataset to the Beneficiary
dataset instead of MemberBen? Would the KeySource for the above KeyLinks be
dsMemberBen or dsBeneficiary?

Yours in learning,
Dion.


-----Original Message-----
From: Helen Borrie (TeamIBO) [mailto:helebor@...]
Sent: Sunday, January 20, 2002 7:39 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Grid lookup


At 07:03 PM 20-01-02 -0800, Dion wrote:
>MainQuery is qryMemberBen:-
> SQL =
> SELECT
> MEMBERBEN.MEMBERID
> , MEMBERBEN.RELATIVETYPEID
> , MEMBERBEN.OPTIONID
> , MEMBERBEN.FUNDID
> , MEMBERBEN.BANKID
> , MEMBERBEN.BRANCHCODE
> , MEMBERBEN.ACOUNTNO
> , MEMBERBEN.ACCOUNTTYPEID
> , MEMBERBEN.BENID
>
> , Beneficiary.ID

, Beneficiary.BENID

> , Beneficiary.TITLEID
> , Beneficiary.INITIALS
> , Beneficiary.FIRSTNAME
> , Beneficiary.SURNAME
> , Beneficiary.HOMETEL
> , Beneficiary.WORKTEL
> , Beneficiary.EMAIL
> , Beneficiary.LANGUAGEID
> , Beneficiary.RSTREET1
> , Beneficiary.RSTREET2
> , Beneficiary.RCOUNTRYID
> , Beneficiary.RPROVINCEID
> , Beneficiary.RCITYID
> , Beneficiary.RSUBURBID
>
> ,(SELECT TITLE
> FROM TITLE /* t */
> WHERE /* t */ TITLE.TITLEID= /* e */ BENEFICIARY.TITLEID) AS BEN_TITLE
>
>FROM MEMBERBEN /* b */
>
> JOIN Beneficiary /* e */
> ON (Beneficiary.BENID = MEMBERBEN.BENID)
>
> WHERE (MEMBERBEN.MEMBERID = :MEMBERID)
> AND (MEMBERBEN.OPTIONID = :OPTIONID)
> AND (MEMBERBEN.FUNDID = :FUNDID)
>
>KeyLinks for qryMemberBen :-
> MEMBERBEN.MEMBERID

BENFICIARY.ID

> BENEFICIARY.BENID

and if BENID covers a unique occurrence of these then you won't need them:

> OPTIONID
> FUNDID

If not, then add their table identifiers too.

You can't mix-and-match aliases and full table identifiers - it's one or
t'other.

>UpdateSQL :-
> EXECUTE PROCEDURE UpdateBen (:TitleID, :Old.TitleId)

This looks suspect. TitleID isn't a key in any of the tables furnishing the
dataset so it's pretty hard to see how you can this to give you a live
dataset. I would expect to see a SP containing input parameters for all the
KeyLinks columns of the main dataset.

>qryTitle SQL=
> SELECT * FROM TITLE

Use a Field list.


>KeyLinks:-
> TITLEID=/* QRYMEMBERBEN */BENEFICIARY.TITLEID
>
>KeyDescLinks :-
> TitleName=QRYMEMBERBEN.BEN_TITLE
>
>The qryMemberBen is a dataset I create in the app(see my previous question
>about this).
>Title test is tagged as COMPUTED.

Dion, get the SQL right or it's never going to work and you are going to
lose a lot of hair. It looks to me as if you need to get yourself up to
score on SQL before you attempt to do these rather curly things with output
sets...unfortunately the IB manuals aren't all that great - most people buy
a third-party book and experiment with their queries interactively (a bit
like drilling arpeggios on the guitar - in music it's called "playing
fitness").

It's a sad but true fact that, though IBO is a great tool, it's far from
being a magic bullet for avoiding the need to learn the technical fundaments
upon which it depends.


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/