Subject RE: [IBO] Updates Fail in Cached Updates
Author Claudio Valderrama C.
> -----Original Message-----
> From: yahoo@... [mailto:yahoo@...]
> Sent: Viernes 1 de Junio de 2001 12:32
>
> With the BDE version I set the DataSet property of each TUpdateSQL
> object so that they all referenced the same TQuery.
>
> With the IBObjects version the DataSet property is read only and so I
> am assigning the TIBOUpdateSQL object to the TIBOQuery using the
> UpdateObject property of the TIBOQuery. However in this case only one
> TIBOUpdateSQL object can be assigned to the TIBOQuery.

A problem that needs to be documented in the migration steps, since others
can have the same issue and be stuck for days. TIBOUpdateSQL is only a hack
to allow faster migration.


> My updates were failing because I had not appreciated this and only
> one of my TIBOUpdateSQL objects was assigned to the TIBOQuery. To
> work around this I am assigning each TIBOUpdateSQL objects to the
> TIBOQuery at the point that I call SetParams and ExecSQL for that
> TIBOUpdateSQL object. This works but perhaps there is a more elegant
> way of achieving the same results with other IBObject components.

You need several UpdateSQL components because you're writing to more than
one table. You have to change it to become either:

a) A TIBOQuery with its properties DeleteSQL, EditSQL and InsertSQL pointing
to stored procedures that will take the parameters and change the multiple
tables. Or leave one UpdateSQL component and invoke from it the stored
procedures.

b) Create handlers for OnCustomDelete, OnCustomEdit and OnCustomInsert
events, but they are only available in TIB_Query native component.

C.