Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Vilhelm-Ion Praisach
  Where is Vilhelm-Ion Praisach?
 Resita
 Romania
 Vilhelm-Ion Praisach
 To: Gerrit Broekhuis
  Where is Gerrit Broekhuis?
 Holten
 Netherlands
 Gerrit Broekhuis
Subject: RE: SQL SELECT using variable with fieldlist
Thread ID: 459675 Message ID: 459677 # Views: 56 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Monday, August 13, 2018 10:19:18 PM         
   



> Hi,
>
> I have a variable containing a list of fields I need to use in a SQL SELECT statement (comma separated list).
> The lenght of this variable can be quite long, as there can be many fields, with long fieldnames. I tried for example:
>
>
SELECT ( m.lcFieldList ) from MAIN_CURSOR INTO CURSOR TEMP_CURSOR READWRITE

>
> This will create TEMP_CURSOR with a single field, containing the content of the variable, and that is not what I need of course.
>
> What is the right syntaxis for a query using a field list?
>
> Regards, Gerrit
>
> Today is only yesterday's tommorrow - Uriah Heep

Try with macrosubstitution, I mean SELECT ( &lcFieldList )

Respectfully
http://praisachion.blogspot.ro/

ENTIRE THREAD

SQL SELECT using variable with fieldlist Posted by Gerrit Broekhuis @ 8/13/2018 10:05:03 PM
RE: SQL SELECT using variable with fieldlist Posted by Vilhelm-Ion Praisach @ 8/13/2018 10:19:18 PM
RE: SQL SELECT using variable with fieldlist Posted by Gerrit Broekhuis @ 8/13/2018 10:22:22 PM
RE: SQL SELECT using variable with fieldlist Posted by Tamar Granor @ 8/13/2018 10:30:29 PM
RE: SQL SELECT using variable with fieldlist Posted by Vilhelm-Ion Praisach @ 8/14/2018 6:55:13 AM
RE: SQL SELECT using variable with fieldlist Posted by Tony Vignone @ 8/13/2018 11:00:46 PM
RE: SQL SELECT using variable with fieldlist Posted by Vilhelm-Ion Praisach @ 8/14/2018 3:21:57 PM
RE: SQL SELECT using variable with fieldlist Posted by Gerrit Broekhuis @ 8/14/2018 4:01:49 PM