Subject Re: [IBO] FOR UPDATE ????
Author Helen Borrie
At 01:36 AM 23/02/2005 +0000, you wrote:


>Ok. Thanx Helen, just wondering about the fact's of the statement
>because i'd see it at one "Technical Information Sheet" in the IBO
>website... thanx for the tips... = :-)
>
>Now i have a question :
>
>
> >IBO
> > implements techniques to make output sets *appear* to be updatable. In
> > summary, this involves identifying the unique key of an output set and
> > constructing update, insert and delete statements for each output
>row that
> > you choose to perform such an operation on, whenever the dataset's
> > RequestLive property is True
>
>Ok, so based in this fact, should be possible that i can resort the
>dataset at the client side by any field that i want, without have to
>refetch all the cursor from the server with a different "order by"
>statement??... is that possible???...

Yes, though your assumptions are a bit wrong. The sets that IBO works with
on the client side are bound to open cursors on the server (actually, to
three cursors!) As I mentioned, there is a lot of hidden stuff going on
across the wire that IBO does to make the set appear "live".

>i mean the unique keys wouldn't be affected by a simple "re-sort" operation

Well, yes, they are. Remember, this is multi-user, not static data, and
every commit affects the contents of a set (and therefore the keys). In
ReadCommitted isolation, the contents of sets are affected even while the
SELECT statement is uncommitted.

>and at many cases this is very practical... i've see that with the IBO
>native controls (Grids)
>this is easy, but what about the TDataset Compatibles??...

Please understand that, in IBO, the controls do not drive the
datasets. The dataset drive the controls. Matters like ordering and the
"windowing" of the data buffers are controlled by the dataset, not the
controls.

The native IBO Ordering* properties are available to TIBOQuery's ancestor,
TIBODataset. There is of course no binding between the TIBO datasets and
the native IBO controls, so you don't get the automatic communication
between a control and a dataset with the VCL controls and TIBODataset, that
you get with TIB_Dataset and the IBO controls. It is feasible to operate
on the Ordering* properties of the TIBODataset components (in code, only)
and to update the controls by code.

> i would like to can re-sort a TIBOQuery asociated to an InfoPower Grid or a
>ReportBuilder pipeLine...

Provided you can make the IP grid or the RB pipeline react to buffer
changes, I don't see why not. Just experiment with it.


>Until now i've been using some VCL "MemoryDataSet's" to can make this
>trick but it's a little inneficient because i need to move all the
>data from a IBOQuery to my MemoryDataset and can reorder the records
>at the way i need, but this eats a lot of time when the number of
>records it's bigger and bigger, and the memory consumed for this is
>too much... so if i could reorder the rows in the IBOQuery itself with
>the data that the cursor have and don't need to go to the server for
>the same data just for a different order, this would make my life a
>lot more easy...

Well, sure, but reordering buffers with huge sets eats a lot of resources,
period. It is much more efficient to cleanly requery the database to get a
fresh ordering. Grouped reports are trickier, of course, because most
report tools need to have everything in the buffer.

Helen