Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select from SPT - Into Array?
Message
 
To
28/08/2009 11:02:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01421480
Message ID:
01421526
Views:
43
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform