Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select from SPT - Into Array?
Message
 
À
28/08/2009 11:02:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01421480
Message ID:
01421526
Vues:
41
Hi Matt,

in one framework I have a sqlVal() function for this:
Procedure sqlVal(tcExpression, tcTable, tcWhere, toP1)
	Local lnSelect
	lnSelect = Select()
	Local lcCmd, luVal
	lcCmd = "Select " + m.tcExpression + " as val"
	If not Empty(m.tcTable)
		lcCmd = m.lcCmd + " from " + m.tcTable
		If not Empty(m.tcWhere)
			lcCmd = m.lcCmd + " WHERE " + m.tcWhere
		EndIf 
	EndIf
	If sqlDo(m.lcCmd,m.toP1,"sqlget")
		luVal = sqlget.val
	EndIf 
	Use in Select("sqlget")
	Select (m.lnSelect)
Return m.luVal
The call would be like this:
? sqlVal("sum(qty*price)","JobItems")
sqlDo is basically SqlExec, except that it gets the handle before.
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform