Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a collection of objects from table rows?
Message
 
 
À
28/12/2008 16:27:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01369892
Message ID:
01369898
Vues:
10
You can easily build such collection.
loRecordSet = CREATEOBJECT("Collection")
SELECT csrChildRecords
SCAN
	SCATTER NAME loRecord MEMO
	loRecordSet.Add(loRecord)
ENDSCAN
>Do you know of a technique that will create a collection of objects where each object in the collection represents a row from a cursor?
>
>Basically, it would be like scattering a cursor to a collection of objects.
>
>Example:
>
>select * from ChildAlias;
> where fkey=ParentAlias.pkey;
> into cursor csrChildRecords
>
>Then, (pseudo code):
>
>scatter Cursor csrChildRecords to Collection collectionChildRecords
>
>or a method call like CreateCollectionFromCursor('CursorName', 'CollectionName')
>
>where the method would have a do/while loop that will create a collection, and then add an object to the collection for each row in the cursor.
>
>Have you seen thee need or application of such an approach?
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform