Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Building SQL to select fields
Message
 
 
À
12/01/2009 11:57:25
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01372854
Message ID:
01372859
Vues:
13
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform