Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and .NET Data Comparison
Message
From
28/12/2005 08:02:28
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01080965
Message ID:
01081209
Views:
12
Hi kevin,

I know this is available in SQL server 2005 and in oracle as well. I wonder however how this performs in comparison to pure record bases approached, where as this seems more of a half set, half set oriented solution. To be honest, I still have to investigate this new feature and how it compares to a pure record oriented approach

Oracles failed attempt to implement a file system on top of a RDBMS indicates however not have a too high expectation.

Walter,



>Consider an employee table. Every employee has a chief (Chief_fk), except the chairman (.NULL). Now given an employee, give me the entire path from that employee to the chairman. The record based solution is far simpler than the set oriented solution:
>
>
>USE EMPLOYEE
>GO RECCOUNT()*RAND() && Get a random record
>? Firstname+" "+Lastname
>DO WHILE SEEK(Chief_fk,"Employee","emp_pk")
> ?? "\"+Firstname+" "+Lastname
>ENDDO

>
>Walter,
>
>FWIW, T-SQL in SQL Server 2005 allows developers to build recursive queries through common table expressions:
>
>
WITH ResultSet (FirstName, LastName, Parent_PK_Value)
>   AS (SELECT FirstName, LastName, Chief_FK
>       FROM Employee
>          WHERE Emp_PK = <somekey>                                          -- anchor query
>       UNION ALL
>          SELECT Employee.FirstName, Employee.LastName, Chief_FK            -- recursive query
>             FROM Employee
>               INNER JOIN ResultSet ON Parent_PK_Value = Employee.Emp_PK)
>
>SELECT * FROM ResultSet
>
>I've run this on a small table (few thousand rows), I'm curious to try it on something larger.
>
>Kevin
Previous
Reply
Map
View

Click here to load this message in the networking platform