Wiki

Scale Your Enterprise

User Tools

Site Tools


bw2:sql_command_tool

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bw2:sql_command_tool [2021/02/09 09:51]
akoehler
bw2:sql_command_tool [2023/12/29 14:09] (current)
wgates [Reader (SQL Server and 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 the same SELECT statement as illustrated above but with a variable in the WHERE clause.+The following shows the same SELECT statement as illustrated above but with a variable in the WHERE clause.
  
-{{  :bw:sqlimage2.png?411x72  }}+<code sql>  
 +SELECT 
 + CardCode, 
 + CardName 
 +FROM ocrd 
 +WHERE CardCode = 'WorkFlow(Variables).Get(CardType)' 
 +</code>
  
 +
 +<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**
 +</WRAP>
 ===== Non-Query (SQL Server only) ===== ===== Non-Query (SQL Server only) =====
  
Line 126: Line 136:
 Changes in the [Result] tab **DO NOT** automatically carry back to the [SQL] tab.  If you make changes in the [Result] tab that needs 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 the best results. Changes in the [Result] tab **DO NOT** automatically carry back to the [SQL] tab.  If you make changes in the [Result] tab that needs 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 the best results.
 </WRAP> </WRAP>
 +
 +====== SQL System Variables ======
 +
 +^ Name           ^ Description         ^
 +| CommandType       | The command type chosen in the SQL tool ex. Reader, Non-Query      |
 +| 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         | The results from executing the query in the workflow. Will only show up when executing the query in the SQL tool and not during the test run      |
 +| QueryString         | The current query that is being executed     |
 +| SQLCommand        | Used for an older version of Bizweaver no longer returns a value    |
 +| SQLResultsCount         | The total amount of records that were retrieved during a query       |
 +|StepMessage       | During a failure the reason for failure will be populated here     |
 +| StepStatus        | True or False     |
 +
  
 ======SQL Tips====== ======SQL Tips======
bw2/sql_command_tool.1612882294.txt.gz · Last modified: 2021/02/09 09:51 by akoehler