Board index » delphi » IBQuery Master Detail Problem

IBQuery Master Detail Problem

I have a master TIBQuery(ibqFlags) and a Detail TIBQuery(ibqDetail) of which
I have linked ibqDetail to the datasource of ibqFlags.  However I still get
'Required ParamValue not set' when trying to activate ibq Detail.

ibqFlags.SQL = select FLAGNAMEID, FLAGNAME from FLAGNAME;
ibqDetail.SQL = select ObjectID from flagdata Left JOIN object on flagID =
:flagNameID;

As far as I remember from my BDE experience as long as the master and detail
queries have the same fieldname that is linked there is no need to provide
the link in code.  Am I missing something here?

I do not wish to have to drop back to the BeforeOpen method :).

Thanks

 

Re:IBQuery Master Detail Problem


<m...@hots.com> skrev i melding news:9i9681$6ls$1@slb2.atl.mindspring.net...

Quote
> I have a master TIBQuery(ibqFlags) and a Detail TIBQuery(ibqDetail) of
which
> I have linked ibqDetail to the datasource of ibqFlags.  However I still get
> 'Required ParamValue not set' when trying to activate ibq Detail.

> ibqFlags.SQL = select FLAGNAMEID, FLAGNAME from FLAGNAME;
> ibqDetail.SQL = select ObjectID from flagdata Left JOIN object on flagID =
> :flagNameID;

> As far as I remember from my BDE experience as long as the master and
detail
> queries have the same fieldname that is linked there is no need to provide
> the link in code.  Am I missing something here?

> I do not wish to have to drop back to the BeforeOpen method :).

Your ibqDetail SQL stmt is a bit odd, you intend to both filter and join
using the same expression (flagID = :flagNameID).
Try something like:

select
  FD.ObjectID
from
  flagdata FD
Left JOIN
  object OB
on
  OB.flagID = FD.ObjectID
where
  FD.flagNameID = :flagNameID

...I just guessed your field names...;-)

--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorgeremovet...@itte.no (remove the obvious)

Other Threads