Difference between revisions of "SQLEVAL()"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Purpose== Function to return the single row result of an SQL statement ==Syntax== SQLEVAL(<SQL statement>) ==See Also== ASTRING(), SELECT, [[SQLVALUES()...")
 
 
Line 29: Line 29:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:SQL]]
 
[[Category:SQL]]
 +
[[Category:SQL Functions]]
 
[[Category:Data Analysis Functions]]
 
[[Category:Data Analysis Functions]]
 
[[Category:Lianja VFP Extensions]]
 
[[Category:Lianja VFP Extensions]]
 
[[Category:VFP Function Extensions]]
 
[[Category:VFP Function Extensions]]

Latest revision as of 08:34, 21 February 2017

Purpose

Function to return the single row result of an SQL statement

Syntax

SQLEVAL(<SQL statement>)

See Also

ASTRING(), SELECT, SQLVALUES()

Description

The SQLEVAL() function executes the <SQL statement> and returns the result as a string. Multiple values from a singleton select are returned as a comma-separated list.

If the <SQL statement> returns multiple rows, only the values from the first row are returned, but the results of all rows are available in the automatically created _sqlvalues array.

The SQLEVAL() function is synonymous with the SQLVALUES() function.

Example

open database southwind
cTotal = sqleval("select max(available), min(available) from example")
 
// Access multiple row results
sqleval('select state from example group by state')
? astring(_sqlvalues)
AL,AR,CA,CO,CT,FL,GA,IA,IL,KY,LA,MA,MD,ME,NH,NJ,NY,OH,PA,VA,WI