This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bw:sql_command_tool [2019/12/09 13:31] akoehler |
bw:sql_command_tool [2022/08/02 10:35] (current) akoehler [SQL System Variables] |
||
|---|---|---|---|
| Line 16: | Line 16: | ||
| The following pages contain additional information that may be helpful with the development of Bizweaver workflows using the SQLCommand tool. | The following pages contain additional information that may be helpful with the development of Bizweaver workflows using the SQLCommand tool. | ||
| - | * [[bw: | + | |
| ====== Before You Begin ====== | ====== Before You Begin ====== | ||
| Line 45: | Line 45: | ||
| * **// | * **// | ||
| * **// | * **// | ||
| - | * **// | + | * **// |
| ===== HANA ===== | ===== HANA ===== | ||
| Line 59: | Line 59: | ||
| - When variables are used, they are subject to standard syntax rules regarding text vs. numeric values. This means that text variables MUST be enclosed in single quotes. | - When variables are used, they are subject to standard syntax rules regarding text vs. numeric values. This means that text variables MUST be enclosed in single quotes. | ||
| - | The following image shows same SELECT statement as illustrated above, but with a variable in the WHERE clause. | + | The following image shows the same SELECT statement as illustrated above, but with a variable in the WHERE clause. |
| {{ : | {{ : | ||
| + | |||
| + | <WRAP center round important> | ||
| + | When saving a workflow or opening the SQL/HANA tool or the workflow, the reader command type will validate the written query. This executes the query against the connected database. **There is the ability to have Non-query commands written using the Reader command type. This will execute the statement against the database. If a Create, Update, Insert, Truncate or Delete (any SQQL/HANA statement that affects a change to any data) is written, the command will execute and be run against the connected database if the workflow is saved or the tool or workflow is opened** | ||
| + | </ | ||
| ===== Non-Query (SQL Server only) ===== | ===== Non-Query (SQL Server only) ===== | ||
| - | - This command is used for UPDATE, INSERT, | + | - This command is used for **UPDATE, INSERT, DELETE |
| - Variables representing values from previous steps can be used in the statement as needed. Press <F4> for a list of available variables. | - Variables representing values from previous steps can be used in the statement as needed. Press <F4> for a list of available variables. | ||
| - Keep in mind that these statements will affect your data immediately. **Use them with care**. | - Keep in mind that these statements will affect your data immediately. **Use them with care**. | ||
| + | - Non-Query cannot be test run | ||
| <WRAP center round important> | <WRAP center round important> | ||
| - | **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 **//[[bw:sap_business_one_integration_for_sql_server_databases#Mapper Tool|Mapper]]// | + | **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 **//[[bw:sap_business_one_integration_using_di#Mapper Tool|Mapper]]// |
| </ | </ | ||
| Line 82: | Line 87: | ||
| {{ : | {{ : | ||
| - | =====Passing Parameters using Stored Procedure (SQL Server only) ===== | + | =====Stored Procedure (SQL Server only) ===== |
| 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. | 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. | ||
| - | ==== Stored Procedures (SQL Server only) ==== | + | ====Passing Parameters using |
| 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: | 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: | ||
| Line 132: | Line 137: | ||
| </ | </ | ||
| - | ======SQL | + | |
| + | ====== SQL System Variables ====== | ||
| + | |||
| + | ^ Name ^ Description | ||
| + | | CommandType | ||
| + | | DataSourceFields |The fields pulled from the data source will only show up when executing the query in the SQL tool and not during a test run| | ||
| + | | DataSourceResultsTable | ||
| + | | QueryString | ||
| + | | SQLCommand | ||
| + | | SQLResultsCount | ||
| + | |StepMessage | ||
| + | | StepStatus | ||
| + | |||
| + | |||
| + | ======SQL Tips====== | ||
| * [[bw:sql tools|Strip HTML Tags From Input String]] | * [[bw:sql tools|Strip HTML Tags From Input String]] | ||