Initializing help system before first use

SQLparam

SQLparam


Purpose
Generate an SQL parameter.
Synopsis
function SQLparam(i:integer):SQLparameter
function SQLparam(r:real):SQLparameter
function SQLparam(s:string):SQLparameter
Arguments
The initial value as an integer
The initial value as a real
The initial value as a string
Return value
SQL parameter suitable for SQL routines.
Example
The following calls a procedure named myproc using 3 parameters. The first one is an input string parameter ( 'hello'), the second is an input/output integer parameter ( 10) and the last one is an output string parameter. The procedure returns a result set that mmodbc will use to initialise result. After execution of the query, the new values of the 2 input/output parameters set by the procedure may be displayed using the appropriate SQLgetparam routines.
SQLexecute("CALL myproc(?,?,?)",
           ['hello',SQLparam(10),SQLparam("")],result)
writeln("P1=",SQLgetiparam(1))
writeln("P2=",SQLgetsparam(2))
   
Further information
1. This routine can only be used in a list of parameters for an SQL query: it defines an input/output parameter. The input value of the parameter is provided via the argument function (an integer, a real or a string) and the output value (set by the database during the execution of the query) can be retrieved using one of the SQLgetparam functions.
2. SQL parameters are typed: the type of the parameter is deduced from its initial values (passed to the SQLparam function).
Related topics
Module