Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building SQL to select fields
Message
 
 
To
12/01/2009 11:57:25
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01372854
Message ID:
01372859
Views:
12
Or you could use AFIELDS() and loop through array.

>UPDATE: Nevermind. Got it:
>
>lcFields = m.lcFields + IIF(m.ix > 1, ', ','') + FIELD(ix) + ' AS Fld'+TRANSFORM(ix)
>
>
>
>
>
>
>
>How do I get the lcFields variable in the code block below to go from this,
>
>Fld1, Fld2
>
>to this?
>
>FieldName1 AS Fld1, FieldName2 AS Fld2
>
>Code block:
>
>PROCEDURE CreateGenericReportCursor( m.AliasToConvert )
>	lcTable = ALLTRIM(UPPER(JUSTSTEM(m.AliasToConvert)))
>	lcFields = ''
>	m.FieldCount = FCOUNT(m.AliasToConvert )
>	FOR ix =1 TO FCOUNT(m.AliasToConvert )
>		lcFields = m.lcFields + IIF(m.ix > 1, ', ','') + 'Fld'+TRANSFORM(ix)
>	ENDFOR
>	RunSQL = 'SELECT ' + lcFields + ' FROM ' + m.AliasToConvert
>	RETURN 
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform