ExecuteSQL()
The ExecuteSQL();
rule executes a prepared
SQL query.
Syntax
The ExecuteSQL();
statement
uses following syntax.
ExecuteSQL ( sql data, [optional variable list] );
Arguments
The following table lists the properties of the arguments of this stitcher rule.Argument | Description | Accepts constants | Accepts variables | Accepts eval clauses |
---|---|---|---|---|
sql data |
The prepared SQL command to execute. The prepared
SQL command is presented as an SQLData variable. Note: SQL queries
must not be terminated with a semi-colon.
|
Yes | Yes | Yes |
optional variable list |
An optional comma-separated list
of variables to be used if placeholders (marked by a question mark
symbol, ? ) are used in the sql data argument. |
Yes | Yes | Yes |
Example
The following example shows how
the ExecuteSQL()
rule is used to execute an SQL statement
that was prepared earlier.
SQLData myData = PrepareSQL(
"insert into entityNameCache
(
entityName,
domainMgrId
)
values
(
?,
?
);"
, "NCIM" ,
eval(text,'$entityName'),
eval(int,'$domainId')
);
ExecuteSQL ( myData );