EXECSQL
Overview
The EXECSQL workflow application allows you to execute one or multiple SQL queries in a process.
EXECSQL lets you retrieve information via SELECT
queries, for example, in order to use the results in process conditions.
How it works
EXECSQL requires the
CONNECTION_NAME
parameter, which corresponds to the connection name, and theQUERY
parameter, which corresponds to the query to execute.You can specify one or multiple commands per EXECSQL action. For this, the parameters must be prefixed by
CMDx_
, wherex
corresponds to the command number (e.g.CMD1_
).The supported query types are
SELECT
,INSERT
,UPDATE
,DELETE
,SCALAR
, andPROCEDURE
.The application supports SQL transaction management.
You can use a global connection for multiple commands. In this case, you must not prefix the
CONNECTION_NAME
parameter withCMDx_
. It is not possible to use a global connection and a local connection (e.g.CONNECTION_NAME
andCMD2_CONNECTION_NAME
).You can use a global transaction for multiple commands. In this case, you must not prefix the
TRANSACTION
parameter withCMDx_
. It is not possible to use a global transaction and a local transaction (e.g.TRANSACTION
andCMD2_TRANSACTION
). It's necessary to define a global connection to be able to define a global transaction.Application logs are available. These can be specified by setting the value of the
ExecSqlLogLevel
parameter in theweb.config
file to0
to deactivate logs,1
for error logs,2
for information logs, or3
for debug logs; the default value is0
.
Required parameters
Parameter | Type | Direction | Description |
| TEXT | IN | Name of the connection to use The connection name must be defined in the WorkflowGen |
| TEXT | IN | Query to execute |
Optional parameters
General
Parameter | Type | Direction | Description |
| TEXT | IN | Type of query to execute The supported types are:
|
| TEXT | IN | When set to |
| TEXT | IN | When set to |
| NUMERIC | IN | Indicates the number of seconds to define in the command execution time
Default: |
| FILE | INOUT |
|
| TEXT | IN | Identifier of the GridView to feed to the |
| TEXT | IN | Separator used in the return value or CSV file Default: |
If you want to populate a GridView using the
FORM_DATA_GRIDVIEW
parameter, the contents ofFORM_DATA
must contain at least the XML schema.If the first action of the process is an EXECSQL action, you must put a default value in
FORM_DATA
, with the definition of the schema.
Query parameters
For each query, you can define parameters to use during execution. These parameters can be defined in two ways: either by using the QUERY_PARAM
prefix or by using an at sign (@
).
📌 Example
You can use QUERY_PARAM_MyParam
or @MyParam
, where MyParam
corresponds to the name of the parameter defined in the query.
Parameter | Type | Direction | Description |
| TEXT | IN |
|
| TEXT | IN |
|
Return parameters
General
Parameter | Type | Direction | Description |
| TEXT | OUT | Contains the error message in the event that the parameter value contains |
| TEXT | OUT | Indicates whether a |
SELECT
query
SELECT
queryParameter | Type | Direction | Description |
| TEXT NUMERIC DATETIME | OUT | Contains the value of the You must replace |
| TEXT NUMERIC DATETIME | OUT | Contains the value of the |
| TEXT | OUT | Contains the query result in |
| FILE | OUT | Contains the query result in |
| TEXT | OUT | Contains the query result in |
| FILE | OUT | Contains the query result in |
| TEXT | OUT | Contains the query result in Data are separated according to the separator defined in the |
| FILE | OUT | Contains the query result in Data are separated according to the separator defined in the |
SCALAR
query
SCALAR
queryParameter | Type | Direction | Description |
| NUMERIC | OUT | Contains the numeric result of a |
Examples
SELECT
query
SELECT
queryStore the results in data
Parameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | OUT |
|
| FILE | OUT |
|
| TEXT | OUT |
|
| FILE | OUT |
|
| TEXT | OUT |
|
| TEXT | OUT |
|
| TEXT | OUT |
|
Populate a GridView
Parameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| FILE | INOUT |
|
| TEXT | IN |
|
If EXECSQL is the first action of the process, you must define a default value for the FORM_DATA
data containing the schema of the array, as shown in the example below:
INSERT
query
INSERT
queryParameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
Here's another possibility for query parameters:
Parameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
UPDATE
query
UPDATE
queryParameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | IN |
|
| TEXT | IN |
|
DELETE
query
DELETE
queryParameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | IN |
|
Stored procedure
Parameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
The PROCEDURE
query type does not return a value. If you want to return a value, you must use the SELECT
type.
Parameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | IN |
|
SCALAR
query
SCALAR
queryParameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | OUT |
|
Launch multiple requests
Parameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| NUMERIC | IN |
|
| TEXT | OUT |
|
Requests with transactions and error management
Parameter | Type | Direction | Value |
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | OUT |
|
| TEXT | OUT |
|
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | IN |
|
| TEXT | OUT |
|
| TEXT | OUT |
|
Last updated