Subject | Live queries |
---|---|
Author | Lele Gaifax |
Post date | 2001-01-25T19:28:44Z |
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.
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.