Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JOINing cursors
Message
From
19/06/1999 12:18:42
 
 
To
18/06/1999 17:30:06
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00231628
Message ID:
00231767
Views:
15
>I wish to create a local cursor, for reporting, from the data in two separate remote tables, each in their own database.
>
>Database D1, table T1 holds Orders and ItemNo
>Database D2, table T2 holds ItemNo and ItemDetail
>
>Both tables are too large to consider bringing either down to my local machine in their entirity.
>
>I currently do:
>
>LcSearchString = “12345”
>
>Handle1 = SQLConnect(“One”)
>LcSQLCode1 = “select T1.Orders, T1.ItemNo FROM T1 WHERE T1.Orders = ?lcSearchString”
>SQLExec(Handle1, lcSQLCode1, “Cursor1”)
>
>Handle2 = SQLConnect(“Two”)
>LcSQLCode2 = “select T2.ItemNo, T2.ItemDetail FROM T2 INNER JOIN Cursor1 ON T2.ItemNo = Cursor1.ItemNo”
>SQLExec(Handle2, lcSQLCode2, “Cursor2”)
>
>The above fails with a misleading message that is sort of the equivalent of file not found. I believe that the last SQLExec can’t see Cursor1
>
>Any thoughts …

You're right, it can't. THe server can't see cursors on the client. YOu need to combine the two above select statements into one:

SELECT T2.ItemNo, T2.ItemDetail FROM T2 INNER JOIN T1 ON T2.ItemNo = T1.ItemNo AND T1.Orders = ?lcSearchString
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform