This is an old revision of the document!
This document describes the use of the Bizweaver SQL Command tool.
This document is intended for developers of Bizweaver workflows.
Knowledge of T-SQL (Microsoft SQL Server) or SAP HANA coding is required to use this tool.
The following pages contain additional information that may be helpful with the development of Bizweaver workflows using the SQLCommand tool.
Global connections required to access a database(s) that is needed must be created before this tool can be used.
SQL Server versions 2008 and higher are supported as well as SAP HANA databases. The SQL connection setup process is described in the SQL Connections section.
Four SQL Server command types are supported:
Only the Reader function is supported for HANA databases at this time.
Standard SQL Server or HANA syntax is used for the commands. The basic syntax of the SQL statement is validated when the [OK] button is clicked. If the statement is not valid an error message is displayed but the step is saved as-is
The following image shows same SELECT statement as illustrated above, but with a variable in the WHERE clause.
For SAP Business One Users: Updates to standard SAP Business One tables should not be done directly using insert, update, or delete. These updates should be done using the Mapper & SBO Updater tools.
This option is included for compatibility with older versions of Bizweaver, and is no longer used. The same thing can be accomplished using a “Non-query” operation as illustrated below. The SQL statement will be the same.
This command can be used to execute a SQL Stored Procedure that does not require parameters. In this case the “exec” statement is not used. All that is required is the name of the procedure. In most cases, it is probably easier to simply always use the Non-Query option to avoid confusion. Use of the Non-Query option is described above.
While there is a “Stored Procedure” command in the SQL Command tool drop down menu, its use is currently limited as it does not support the use of input parameters. To address this, the Non-Query command can also be used to execute stored procedures that include parameters for execution. In this case the “exec” statement must be included in the command. The parameters are passed using standard SQL Server syntax. For example, assume a stored procedure that includes two parameters. The SQL statement would be:
EXEC Stored_Proc_Name parm1, parm2
Variables representing values from previous steps can be used in the statement as needed. Press <F4> for a list of available variables.
'WorkFlow(GetData).Get({FIELD_ItemCode})'
Bizweaver version 2.3 introduces the Test Run option in the SQLCommand tool. This option allows you to test SQL functions without running through the entire workflow. It also allows you to test SQL steps where the input involves variables from previous steps. The example here uses the following SQL statement.
To invoke this option click on the “Test Run” link in the lower-right corner of the tool window. The display changes to the test view.
Test view
The [Result] tab displays the results of the SQL statement. The statement can be modified in this tab to add/change the statement as needed for testing. This includes adding/changing variable values. Click the green Run link to execute the modified statement. This may be done as many times as needed.
In this example we can enter a valid value where the variable will be used to test the statement.
WHERE t0.CardCode = 'WorkFlow(Variables).Get(CardCode)'
Changes in the [Result] tab DO NOT automatically carry back to the [SQL] tab. If you make changes in the [Result] tab that need to be in the “real” SQL statement, you must add them manually. Once the test is modified you should copy the code and then exit the test view and past them in the SQL section for best results.
Click the green Run link to execute tests. If you click the “Test Run” link again the results will revert to the statement in the [SQL] tab.
——SQL Tools——