wwHTTPSQL::AddSQLParameter

Adds named parameters that can be used in SQL statements or commands.

Parameters are marshalled to the server and recreated on the server running the SQL statement on the server. SQL Server will use SQL Passthrough syntax for parameters (using ? syntax) while Fox data will use straight parameters. Output parameters in stored procedures should be prefixed by both the ? and the @ in SQL Server (Execute someSP 'parm1',?@pnID).

o.AddSQLParameter(lcName,lvValue,lcType,llReturn)

Parameters

lcName

lvValue

lcType

llReturn

Example

oHSQL = CREATEOBJECT("wwHTTPSQL")
oHSQL.cServerUrl = "http://localhost/wconnect/wc.dll?http~httpsql"
oHSQL.cSQLCursor = "TDevelopers"

pnID = 0
pcTablename = "wwDevRegistry"


oHSQL.AddSQLParameter("pnID",pnID,,.T.)  && Return this one back 
oHSQL.AddSQLParameter("pcTableName",pcTableName)
oHSQL.AddSQLPArameter("pcIDTable","wwr_id")
oHSQL.AddSQLParameter("pcPKField","pk")

? oHSQL.Execute("Execute sp_ww_NewId ?pcTableName,?@pnID")

*** pnID result value
? oHSQL.vResultValue

*** or explicitly retrieve a return value
? oHSQL.GetSQLReturnValue("pnID")

See also:

Class wwHTTPSQL

© West Wind Technologies, 1996-2024 • Updated: 04/03/18
Comment or report problem with topic