Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing string into a SQL statement
Message
 
À
22/12/2008 12:16:17
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:
01369199
Message ID:
01369202
Vues:
12
Somthing like this? (Quick solution, not even declared variables)
? Parse("Race.RaceCode, RaceDesc")

function Parse(vNewVal)
nPoint	= At('.', vNewVal)
cSelect	= []
if nPoint > 1
	cAlias	= Left(vNewVal, nPoint - 1)
	cSelect	= [SELECT ]
	for nLine = 1 to Alines(laLines, Substr(vNewVal, nPoint + 1), 1 + 4, ',')
		cSelect	= cSelect + Iif(nLine = 1, [], [, ]) + laLines[nLine] + [ AS F] + Transform(nLine)
	next nLine
	cSelect	= cSelect + [ FROM ] + cAlias
endif
return cSelect
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform