Difference between revisions of "SQLVALUES()"

From Lianjapedia
Jump to: navigation, search
Line 9: Line 9:
  
 
==Description==
 
==Description==
The SQLVALUES() function executes the <SQL statement> and returns the result as a string.  The required <SQL statement> cannot return multiple rows.  If a SELECT statement is specified it must be a singleton select.
+
The SQLVALUES() function executes the <SQL statement> and returns the result as a string.  The required <SQL statement> cannot return multiple rows.  Multiple values are returned as a comma separated list.
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
 
open database southwind
 
open database southwind
cTotal = sqlvalues("select count(*) from orders")
+
cTotal = sqlvalues("select max(available), min(available) from example")
 
</code>
 
</code>
  

Revision as of 11:51, 10 December 2012

Purpose

Function to return the single row result of an SQL statement

Syntax

SQLVALUES(<SQL statement>)

See Also

SELECT

Description

The SQLVALUES() function executes the <SQL statement> and returns the result as a string. The required <SQL statement> cannot return multiple rows. Multiple values are returned as a comma separated list.

Example

open database southwind
cTotal = sqlvalues("select max(available), min(available) from example")