Difference between revisions of "XL3RunSQL"

 
(8 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
==Syntax==
 
==Syntax==
  
{{Code|XL3RunSQL( ExcecuteSQL, ConnectionString, SQLStatement)}}
+
{{Code|XL3RunSQL( ExcecuteSQL, Connection, SQLStatement, [TableSheet], [Table])}}
  
 
==Parameters==
 
==Parameters==
Line 11: Line 11:
 
|-
 
|-
 
| {{Code|ExecuteSQL}}
 
| {{Code|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.
+
| A cell reference that contains {{Code|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.
 
|-
 
|-
| {{Code|ConnectionString}}
+
| {{Code|Connection}}
| The connection string to use when running the writeback
+
| The connection to use to connect to the database. This can either be the Connection ID of a workbook relational connection or a connection string.
 
|-
 
|-
 
| {{Code|SQLStatement}}
 
| {{Code|SQLStatement}}
 
| The SQL statement to run
 
| The SQL statement to run
 +
|-
 +
| {{Code|[TableSheet]}}
 +
| Optional - Worksheet name containing query table or XLCubed Table to refresh after the SQL has run
 +
|-
 +
| {{Code|[Table]}}
 +
| Optional - The name of the query table or XLCubed Table to refresh after the SQL has run
 
|}
 
|}
  
 
==Examples==
 
==Examples==
  
{{Code|==XL3RunSql(J3,CommentData!$G$1,L3)}}
+
{{Code|XL3RunSql(J3,CommentData!$G$1,L3)}}
  
''When J3 is set to TRUE (via an [[XL3Link]] then the SQL statement in L3 is run using the connection string specified in CommentData!G1. After completion J3 will be reset to FALSE - ready for the next update by an XL3Link''
+
''When J3 is set to TRUE (via an [[XL3Link]]) then the SQL statement in L3 is run using the connection string specified in CommentData!G1. After completion J3 will be reset to FALSE - ready for the next update by an XL3Link. Note that to use this on XLCubed Web Edition, the XL3Link should be of type 3 (HyperLink with submit changes on web).''
  
 
==See Also==
 
==See Also==
 
* [[Formula Reference]]
 
* [[Formula Reference]]
 
* [[XL3Link]]
 
* [[XL3Link]]
 +
* [[XL3RunSQLProc]]
  
 
[[Category:Formulae]]
 
[[Category:Formulae]]
 
[[Category:Report Management Formulae]]
 
[[Category:Report Management Formulae]]
 
[[Category:Report Management]]
 
[[Category:Report Management]]

Latest revision as of 15:58, 18 September 2018

Allows a SQL Statement to be run when required (used in conjunction with XL3Link to trigger the execution)

Syntax

XL3RunSQL( ExcecuteSQL, Connection, SQLStatement, [TableSheet], [Table])

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. This can either be the Connection ID of a workbook relational connection or a connection string.
SQLStatement The SQL statement to run
[TableSheet] Optional - Worksheet name containing query table or XLCubed Table to refresh after the SQL has run
[Table] Optional - The name of the query table or XLCubed Table to refresh after the SQL has run

Examples

XL3RunSql(J3,CommentData!$G$1,L3)

When J3 is set to TRUE (via an XL3Link) then the SQL statement in L3 is run using the connection string specified in CommentData!G1. After completion J3 will be reset to FALSE - ready for the next update by an XL3Link. Note that to use this on XLCubed Web Edition, the XL3Link should be of type 3 (HyperLink with submit changes on web).

See Also