Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing string into a SQL statement
Message
From
22/12/2008 12:31:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/12/2008 12:16:17
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01369199
Message ID:
01369203
Views:
8
>Trying to build SQL from a RowSource. I want to turn this:
>
>vNewVal = "Race.RaceCode, RaceDesc"
>
>Into this:
>
>"SELECT RaceCode AS F1, RaceDesc AS F2 FROM Race"
>
lcTable = JUSTSTEM(m.vNewVal)
vNewVal = SUBSTR(m.vNewVal, LEN(m.lcTable)+2)
lcFields = ''
for ix =1 to alines(arrF, m.vNewVal, 1, ',')
  lcFields = m.lcFields + iif(m.ix > 1, ',','') + ;
  	textmerge( '<<arrF[m.ix]>> as F<<m.ix>>' )
ENDFOR

SELECT &lcFields FROM (m.lcTable)
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
Previous
Reply
Map
View

Click here to load this message in the networking platform