Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Merge SQL PassThru Result Sets
Message
De
11/04/2005 07:58:35
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
11/04/2005 07:47:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01003317
Message ID:
01003319
Vues:
15
>Hi,
>
>I have an interesting challenge. I am getting back from a SQL passthru stored procedure call, four separate result set cursors that when combined, create a single logical table. Across the result set(s), all column names are unique.
>
>Say the primary table name is "Client". I get back "Client", "Client1", "Client2", "Client3". I effectively want to add the columns in Client1-3 into Client. I have tried ALTER TABLE on the original Client table but there are numerous restrictions, not least of which, the long field names coming back from SQL server are illegal (over 10 chars) when trying to add them to the Client table - Client cursor is a SQL passthru cursor and is not defined in a DBC. In these circumstances, ALTER TABLE treats Client as a "free table" and imposes the column name limits.
>
>The data in Client is a single row. The data in Client1-3 are single rows and I need to add each column and its data as additional column(s) in Client. Make sense?
>
>Thanks,

Gary,
(Note:not completely understood)
AFAIK you can't use alter table in SPT cursors. Probably what I'd do is to create a temp cursor doing a:
select ... from client1..3 into cursor crsTemp readwrite
Do my processing in temp cursor and handle any updates through SPT.

OTOH I see VFP9 is your version. Then cursorAdapters and CursorSchema might be an easier path.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform