Difference between revisions of "XL3RunSQL2"
(Created page with "Allows a SQL Statement to be run when required (used in conjunction with XL3Link to trigger the execution) ==Syntax== {{Code|XL3RunSQL2( ExcecuteSQL, Connection, SQLStat...") |
m (Text replacement - "XLCubed" to "FluenceXL") |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | Available in V10.0.128+, allows a SQL Statement to be run when required (used in conjunction with [[XL3Link]] to trigger the execution) | |
==Syntax== | ==Syntax== | ||
− | {{Code|XL3RunSQL2( ExcecuteSQL, Connection, SQLStatement, | + | {{Code|XL3RunSQL2( ExcecuteSQL, Connection, Datasource, SQLStatement, @p1, @p2, ....,@p27)}} |
==Parameters== | ==Parameters== | ||
Line 14: | Line 14: | ||
|- | |- | ||
| {{Code|Connection}} | | {{Code|Connection}} | ||
− | | The connection to use to connect to the database. | + | | The connection to use to connect to the database. Can only be Connection ID of a workbook relational connection. |
+ | |- | ||
+ | | {{Code|Datasource}} | ||
+ | | Connection specific information, generally not needed and can be left blank | ||
|- | |- | ||
| {{Code|SQLStatement}} | | {{Code|SQLStatement}} | ||
| The SQL statement to run | | The SQL statement to run | ||
|- | |- | ||
− | | {{Code|[ | + | | {{Code|[@p1..@p27]}} |
− | | Optional - | + | | Optional - Parameters passed to the SQL, reference the parameters using @p1,@p2 in the SQL Statement. Strings will automatically get escaped with apostrophes |
− | |||
− | |||
− | |||
|} | |} | ||
==Examples== | ==Examples== | ||
− | {{Code| | + | {{Code|XL3RunSql2(J3,1,"","Insert into test(value) select @p1",L4)}} |
− | ''When J3 is set to TRUE (via an [[XL3Link]]) then the SQL statement | + | ''When J3 is set to TRUE (via an [[XL3Link]]) then the SQL statement is run using the connection 1 passing the parameter in L4. After completion J3 will be reset to FALSE - ready for the next update by an XL3Link. Note that to use this on FluenceXL Web Edition, the XL3Link should be of type 3 (HyperLink with submit changes on web).'' |
==See Also== | ==See Also== |
Latest revision as of 09:52, 4 July 2023
Available in V10.0.128+, allows a SQL Statement to be run when required (used in conjunction with XL3Link to trigger the execution)
Contents
[hide]Syntax
XL3RunSQL2( ExcecuteSQL, Connection, Datasource, SQLStatement, @p1, @p2, ....,@p27)
Parameters
Parameter | Description |
---|---|
ExecuteSQL | A cell reference that contains TRUE when the SQL Statement should be run. After execution the cell reference will be set to FALSE or an error message if an error occurred. |
Connection | The connection to use to connect to the database. Can only be Connection ID of a workbook relational connection. |
Datasource | Connection specific information, generally not needed and can be left blank |
SQLStatement | The SQL statement to run |
[@p1..@p27] | Optional - Parameters passed to the SQL, reference the parameters using @p1,@p2 in the SQL Statement. Strings will automatically get escaped with apostrophes |
Examples
XL3RunSql2(J3,1,"","Insert into test(value) select @p1",L4)
When J3 is set to TRUE (via an XL3Link) then the SQL statement is run using the connection 1 passing the parameter in L4. After completion J3 will be reset to FALSE - ready for the next update by an XL3Link. Note that to use this on FluenceXL Web Edition, the XL3Link should be of type 3 (HyperLink with submit changes on web).