Difference between revisions of "SQLVALUES()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to return the single row result of an SQL statement
 
Function to return the single row result of an SQL statement
 
  
 
==Syntax==
 
==Syntax==
 
SQLVALUES(<SQL statement>)
 
SQLVALUES(<SQL statement>)
 
  
 
==See Also==
 
==See Also==
[[CONNECTED()]], [[GATEWAY()]], [[LOGIN]], [[LOGOUT]], [[MODIFY GATEWAY]], [[SET GATEWAY]]
+
[[SQL SELECT|SELECT]]
 
+
  
 
==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.  If a SELECT statement is specified it must be a singleton select.
 
The SQLVALUES() function can only be used with an active gateway connection.
 
 
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
login "Oracle","node","user","Password"
+
open database southwind
// Count the number of records in the employee table
+
cTotal = sqlvalues("select count(*) from orders")
cTotal = sqlvalues("SELECT COUNT(*) FROM emp")
+
total=val(cTotal)
+
// Count the number of records in the employee table matching the key "Mr"
+
cTotal = sqlvalues("SELECT COUNT(*) FROM emp WHERE title = 'Mr'")
+
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:Remote Data Connectivity]]
 
[[Category:Remote Data Connectivity Functions]]
 
 
[[Category:SQL]]
 
[[Category:SQL]]

Revision as of 11:32, 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. If a SELECT statement is specified it must be a singleton select.

Example

open database southwind
cTotal = sqlvalues("select count(*) from orders")