Subject | Re: [IBO] Displaying updated values from JOINED columns |
---|---|
Author | Helen Borrie |
Post date | 2004-06-07T23:20:41Z |
At 02:30 PM 7/06/2004 -0700, you wrote:
set. This is because the current state of the tables can not be got by
querying either one table or the other.
With an inner join (theoretically) a Refresh should be enough, if Keylinks
are correct, because the parser can pick out enough parameter values for
the two tables from the Fields[] array to requery just the changed
row(s). With an outer join, it can't, because there are potentially nulls
in the keylinks of the right-hand table.
So, for an outer joined set, a full Close and Open following the Commit is
the only way to refresh the set. The same would be true for an inner join
if your Keylinks are wrong, because IBO would use the db_key for uniqueness
in the buffer and the db_key doesn't survive a commit.
As you're converting from the BDE, it should be noted that IBO handles
joined sets differently from the way the BDE does. IBO uses the
InternalDataSet (a TIB_Dataset) of the dataset object to enable
RequestLive; the BDE doesn't have any way to make a joined set "live".
Helen
>I have a TIBOQuery with some joined fields for descriptionsIt *is* necessary to requery the entire set after updating a joined
>
>== simplified snip ===
>SELECT A.ID
> B.NAME
>FROM MAIN A
>LEFT OUTER JOIN LOOKUP B
>ON (A.ID = B.ID)
>==========
>
>This datasource for this dataset is linked to some edit fields and a DBGrid.
>
>Unfortunately, after I edit the ID field in a TadvDBLookupColumnComboBox
>field the NAME field in the
>Grid is not updated.
>
>I have tried all different flavors of CommitAction and calling Refresh.
>Nothing seems to work other
>than closing and reopening the Query.
set. This is because the current state of the tables can not be got by
querying either one table or the other.
With an inner join (theoretically) a Refresh should be enough, if Keylinks
are correct, because the parser can pick out enough parameter values for
the two tables from the Fields[] array to requery just the changed
row(s). With an outer join, it can't, because there are potentially nulls
in the keylinks of the right-hand table.
So, for an outer joined set, a full Close and Open following the Commit is
the only way to refresh the set. The same would be true for an inner join
if your Keylinks are wrong, because IBO would use the db_key for uniqueness
in the buffer and the db_key doesn't survive a commit.
As you're converting from the BDE, it should be noted that IBO handles
joined sets differently from the way the BDE does. IBO uses the
InternalDataSet (a TIB_Dataset) of the dataset object to enable
RequestLive; the BDE doesn't have any way to make a joined set "live".
Helen