Subject Re: [IBO] is this possible?
Author Helen Borrie
At 06:11 PM 15/02/2005 +0200, you wrote:

>have tables:
>TourTable : TourID (PK)....
>GroupTable: GroupID (PK) , TourID (FK) , ....
>GroupMemb : GroupMemID (PK), GroupID (FK), MemID (FK) , ....
>Each TourID could have different (under some circumstances) number of
>GroupID; each GroupID could also have different number of MemID.
>I want to get all TourID information in grid (IBObjects TIB_Grid) so,
>that each grid line would represend all GroupMemID with the same
>(each line shows this group member IDs), result example could be such:
>GroupID1 GroupMemID01 GroupMemID02 GroupMemID03 GroupMemID04
>GroupID2 GroupMemID05 GroupMemID06 GroupMemID07 NULL
>GroupID3 GroupMemID08 GroupMemID09 GroupMemID10 NULL
>Would like to write selectable SP, but don't know, how to manage
>dynamic output field number (in one case could be into :GroupID ,
>:GroupID1, :GroupID2, in an another case - into :GroupID, :GroupID1,
>:GroupID2, :GroupID3, :GroupID4).
>Is this possible with the FB1.5 selectable procedure & IBObjects? for
>display going to use modified TIB_Grid component

No. TIB_Grid displays a set with a known number of output fields. A
selectable SP must also output a set of known structure. You could devise
a SP that would output a pivot set with a known maximum number of columns,
and have it output nulls for those groupings with fewer than the maximum
number of groups (as your example implies). Then, IB_Grid could handle the

IB/FB don't support pivot sets "out-of-the-box" and IBO doesn't have any
controls that would know what to do with them for searching or ordering. I
don't know of any mechanism whereby you could get a pivot set with a
variable number of columns.

The better way to do this would be with a master-detail structure, using
multiple sets, so that the interface could respond to changes hierarchically.