wwUtils::CollectionToCursor

Updates a cursor from a collection by doing GATHER NAME MEMO for each member. An optional search expression can be provided for each item to allow updating existing records.

CollectionToCursor(loCollection, 
    lcAlias, 
    lcSearchExpression)

Return Value

.T. or .F.

Parameters

loCollection
The collection of SCATTER NAME style objects to save.

lcAlias
Alias of the table to import to. If not passed ALIAS() is used.

lcSearchExpression
An optional expression that allows comparing records to find matches to update. Example: "pk = item.pk"

The expression is evaluated using macro substitution. The collection item is available as 'item' (ie. item.pk, item.descript etc.)

Remarks

The cursor that is to receive the data has to exist. If necessary create a cursor using CREATE CURSOR or by selecting an empty SELECT READWRITE query set.

Example

*** Create a collection from Data
select * from Customers INTO CURSOR TQuery
loData = CursorToCollection("TQuery")

close data

*** Create cursor to receive the data
SELECT * FROM Customers where .F. ;
         INTO CURSOR TQuery READWRITE

*** Load data into a cursor from a collection
CollectionToCursor(loDataCollection,"Tquery")

See also:

Class wwUtils | wwUtils::CursorToCollection

© West Wind Technologies, 2018 • Updated: 05/30/18
Comment or report problem with topic