Subject Re: [IBO] master-detail relation with SP
Author Helen Borrie
At 03:39 PM 27/11/2003 +0100, you wrote:
>Trying to set master-detail (MD) relation with stored procedures on the
>same table (which will be large).
>One TIB_Query selects ID, Name & Surname using stored procedure
>Select_Short: select * from Select_Short;
>the second TIB_Query selects detailed info for the selected row (all
>selects via stored procedures work with the same table!) via stored
>procedure Select_Detail(:ID), which retrieves Name, Surname, Age, Gender &
>other info:
>select * from Select_Detail(:ID);
>
>how to set second query to follow master dataset? assigned second's query
>mastersource to the first, but how to set ID param?
>Using FB 1.5 rc7, IBO 4.2Ie, Builder 6

Still use Mastersource but use MasterParamLinks instead of MasterLinks. In
this case:

ID=ID

This of course can only be used to *represent* a M/D relationship in your
application, since it is not realising a M/D relationship that exists in
the database...as soon as you change something in either the
"pseudo-master" or the "pseudo-detail" the "other side" of the relationship
will be broken. You'll be able to define customSQL for editing purposes
but the datasets will then both be out of date. SPs aren't views! You
will have run both SPs again after committing, to get a fresh view.

heLen