Expert Software Company : News

miercuri, 14 iulie 2010

Buffering

Un cursor cu buffering=5 (table buffering) poate rezolva mai simplu problema. Pentru a elimina o inregistrare e suficienta o comanda TABLEREVERT(.f.). La sfarsitul editarii, TABLEUPDATE(.T.) comite bufferul in cursor.


CREATE CURSOR cc (f1 i, poz i)
CURSORSETPROP("Buffering",5)
FOR ii=1 TO 20
INSERT INTO cc (f1) VALUES (ii)
next
BROWSE LAST
SET SQLBUFFERING ON
GO 7
lnpoz=ABS(RECNO()) && Inregistrarile adaugate in buffer au recno() negativ
SELECT ABS(RECNO()) as rec, * FROM cc WHERE ABS(RECNO())=lnpoz INTO CURSOR cy ORDER BY 1
TABLEREVERT(.t.,'cc')
INSERT INTO cc (f1, poz) SELECT f1, rec FROM cx
APPEND BLANK IN cc
INSERT INTO cc (f1, poz) SELECT f1, rec FROM cy
SELECT cc
BROWSE nowait
SET SQLBUFFERING OFF &&daca e cazul

Niciun comentariu:

Trimiteți un comentariu