Subject | Re: [IBO] Live queries |
---|---|
Author | Lucas Franzen |
Post date | 2001-01-25T19:50:49Z |
Lele,
take a TIB_Query (not must, but better than IBOQueries) and enter your
update statement in the EditSQL property.
If you want to update just one side of the join, you can enter sth.
like:
UPDATE TABLE SET
FIELD_NAME1=:FIELD_NAME1,
FIELD_NAME2=:FIELD_NAME2,
..
WHERE
FIELD_X=:FIELD_X
All these params represent the select fields and by supplying and
UpdateStatement you can make them data-aware.
If you need to update more than one table you can write a procedure that
will do the updates, pass all your fields as input params to the
procedure and enter sth. like that in the EditSQL:
execute procedure sp_update_join ( :FIELD_NAME1, :FIELD_NAME2, ...)
HTH
Luc.
Lele Gaifax schrieb:
take a TIB_Query (not must, but better than IBOQueries) and enter your
update statement in the EditSQL property.
If you want to update just one side of the join, you can enter sth.
like:
UPDATE TABLE SET
FIELD_NAME1=:FIELD_NAME1,
FIELD_NAME2=:FIELD_NAME2,
..
WHERE
FIELD_X=:FIELD_X
All these params represent the select fields and by supplying and
UpdateStatement you can make them data-aware.
If you need to update more than one table you can write a procedure that
will do the updates, pass all your fields as input params to the
procedure and enter sth. like that in the EditSQL:
execute procedure sp_update_join ( :FIELD_NAME1, :FIELD_NAME2, ...)
HTH
Luc.
Lele Gaifax schrieb:
>
> Hi everybody,
>
> I'm new to IBO, and I'm trying to convert an application currently
> based on IBX.
>
> The form I'm working on allows the editing of a "tree" of records. I
> have a recursive SP that takes 4 params and returns a flat
> dataset. To edit the tree, I have a DataModule that provides the
> needed functionality. With IBX I had CachedUpdates=TRUE and in
> `OnUpdateRecord' I applied the changes by calling the DM methods.
>
> I chose an TIBOQuery as the TIBQuery replacement, and tried to get a
> live result, without luck. My SQL is the following, basically the same
> as what I used with IBX except for the final "FOR UPDATE" and the use
> of "?" instead of ":" for params (sorry for the italian names):
>
> SELECT oap.Modello, oap.VarianteModello, oap.Tipologia, oap.Zona CodZona,
> oap.Operazione CodOpz, oap.Descrizione, oap.Moltiplicatore,
> oap.PercCalcoloRendimento, oap.PercCalcoloEfficienza,
> oap.OpzChiave, oap.OpzTerminale, oap.ClasseTempi,
> oap.Tempo100,
> TimeToString (oap.Tempo100/100/60/24, 'hh:nn:ss') Tempo100Vis,
> liv.CostoMin, oap.PercFlessibilita, oap.NImpulsi
> FROM OperazioniVarianteModello (?CODICE,?CODVARMOD,0,0) oap
> LEFT JOIN TempiOpz topz ON (topz.CodTip=oap.Tipologia AND
> topz.CodZona=oap.Zona AND
> topz.CodOpz=oap.Operazione AND
> topz.CodClasseT=oap.ClasseTempi)
> LEFT JOIN Livelli liv ON (liv.Codice=topz.LivelloOpt)
> WHERE oap.OpzNormale='T'
> ORDER BY oap.Zona, oap.Operazione
> FOR UPDATE
>
> The procedure `OperazioniVarianteModello' gets its data from a table,
> the one I have to update of course. I have the key (MODELLO,
> VARIANTEMODELLO, TIPOLOGIA, ZONA, OPERAZIONE) of which I have to
> update (MOLTIPLICATORE, ...., OPZTERMINALE). The remaining fields are
> read-only.
>
> I tried playing with CachedUpdate and RequestLive, but all I get is
> the obvious exception on altering a read-only dataset.
>
> How should I operate with IBO? How can I convince the component that I
> know what I'm doing in the OnUpdateRecord event?
>
> thanx a lot in advance,
> bye, lele.
> --
> nickname: Lele Gaifax | Quando vivro' di quello che ho pensato ieri
> real: Emanuele Gaifas | comincero' ad aver paura di chi mi copia.
> email: lele@... | -- Fortunato Depero, 1929.