Subtasks to establish a database connection and return query output in desired format
There are 3 subtasks part of this package:
A subtask that will open a connection to the specified database, run the query or stored procedure, closes the connection with the database and returns the query output. It uses the following input variables:
The name of the DB Server to connect to
The name of the database to connect to
The query or stored procedure to be executed
Use one of the following values:
- Query Table
the output of the query will be in a table format and stored in variable o_table
- Query Value
the output of the query will be in a list format and stored i variable o_val_id
- Insert only
runs the query and no output is expected
- Update only
runs the query and no output is expected
- Insert Get ID
runs the query and expects the query to include the select for the identifier that will be stored in o_out_id
- Update Get ID
runs the query and expects the query to include the select for the identifier that will be stored in o_out_id
A subtask similar to DB-Interaction except that it will not close the connection to the database. It will open a connection to the specified database, run the query or stored procedure and returns the query output. Besides that it will also return the DB Connection Handle (structure variable). It uses the same input variables as the DB interaction with the following addtitional input variable:
This is a structure input variable containing the connection handle to the database. When this variable is used then the i_sql_server and i_db_name variables do not need to be supplied as the existing open connection handle with the database will be used.
This is a structure output variable containing the connection handle to the database.
This subtask is used to close the connection with the database. It only requires the following input variable:
This is a structure input variable containing the connection handle to the database.
Download the Studio Package file and Import it into your Cortex Environment. Don't forget to apply rights using the Studio Authorization module.
👍 Enjoy! 😉