Difference between revisions of "SQLPARAMS()"

From Lianjapedia
Jump to: navigation, search
 
Line 44: Line 44:
 
[[Category:ODBC Functions]]
 
[[Category:ODBC Functions]]
 
[[Category:SQL Functions]]
 
[[Category:SQL Functions]]
 +
[[Category:Lianja v3.2]]

Latest revision as of 10:30, 30 January 2017

Purpose

Expand the ? parameter values from a SQL statement

Syntax

SQLPARAMS(<cSQLCommand> [, <cDBType>])

See Also

SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLCONNECT(), SQLDISCONNECT(), SQLERROR(), SQLEXEC(), SQLGETPROP(), SQLMORERESULTS(), SQLPREPARE(), SQLROLLBACK(), SQLSETPROP(), SQLSTRINGCONNECT(), SQLTABLES(), SQLTRANSACTION()

Description

The SQLPARAMS() function is used to expand the ? parameter values from a SQL statement.

Keywords Description
cSQLCommand The SQL statement to be expanded.
cDBType Optional. The remote database type.

SQLPARAMS() returns the full SQL statement with all ? parameters expanded.

Example

cName = "%Mountain%"
cColor = "Black"
 
cSQL = "select * from Production.Product where name like ?cName " + ;
       "and color = ?cColor"
nStatHand = sqlconnect("lianja_mssqltest")
sqlprepare(nStatHand,cSQL)
sqlexec(nStatHand)
list
 
? sqlparams(cSQL, "MSSQL")
// Returns: select * from Production.Product where name like '%Mountain%' and color = 'Black'
sqldisconnect(nStatHand)