Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Side by side comparison (strings & local data)
Message
De
05/01/2004 14:12:38
Walter Meester
HoogkarspelPays-Bas
 
 
À
05/01/2004 05:00:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00861648
Message ID:
00863977
Vues:
27
Hi kevin,

>>>I was actually more interested in the local-data performence, I think I may have to try something else, the string handling side of it I'm not too bothered about.
>>
>>I don't see how your example has much to do with the local data-engine. The scan is very quick and percentage wise does not play any role in the whole picture.

>That's what I meant, I need to test the local-data engine more than I have done.

Suprisingly the Cetin and I came up with the following result that indeed uses the local database engine to perform the fastest solution up to now. See Re: Side by side comparison (strings & local data) Thread #861648 Message #862781


>>2. My favourate: From a retrieved dataset, get the upper boss of a random employee. In VFP you can use an index and a loop, In c# You've got to dig into the derived collection. Lets test this for 100 and 1000 records.
>
>Could you briefly outline the data-structure for this, 2 tables or just the 1?

One table, having a PK that identifies the employee, and one FK to the PK that identifies the direct superiour of this employee.
LPARAMETER nEmpID

SELECT Employees
SET ORDER TO EmpID

DO WHILE SuperiourID <> 0 AND SEEK(SuperiourID)
ENDDO
RETURN Employees.EmpID
>>3. A very common one for reporting. Some integer value from the backend translates into a meaningfull character value or is a key to another local table. Munge the data so that it becomes one table again suitable for reporting (Note that in VFP you'd probably use a SQL SELECT Command to do this. Since C# is not capable of doing this locally, you'd probably end up doing relations in ADO.NET). Let's do this for 10, 100 and 1000 records.

>If we're talking SELECT you can achieve this when you execute the initial query.

That is not the goal. Sometimes you retrieve two datasets seperately (because one is a fairly static one and is only downloaded once and is used for joins in dynamic data or populating popups etc.) You can do this as well with ADO.NET by setting relations, simular to SET RELATION.

SELECT * FROM x INNER JOIN y ON x.pk = y.pk INTO CURSOR z

Note you cannot do this with SQL in ADO.NET since the datasets are already local.

>>4. From a retrieved dataset increase the value of any numeric column with 1 for any odd value. Lets do this for 10, 100 and 1000 records.

REPLACE AnyColumn WITH anyColumn + 1 FOR anyColumn % 2 = 1

>OK.

>>5. From a retrieve dataset containing a year, replace the value of any column with a any value for every leap year.

>OK.

REPLACE AnyColumn WITH nAnyValue FOR Year % 4 = 0 AND (Year % 100 # 0 OR Year % 400 = 0)

>Considering time-constraints on my half, it would be great if you could provide some VFP code for these exercises, just so I'm absolutely sure.

Walter,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform