Skip to content

Subtasks to establish a database connection and return query output in desired format

License

Notifications You must be signed in to change notification settings

IntelligentAutomationCommunity/DB-Interaction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

DB-Interaction

Subtasks to establish a database connection and return query output in desired format

There are 3 subtasks part of this package:

DB-Interaction

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:

- i_sql_server

The name of the DB Server to connect to

- i_db_name

The name of the database to connect to

- i_query

The query or stored procedure to be executed

- i_action

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

DB-Interact

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:

- i_db-handle

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.

- o_db-handle

This is a structure output variable containing the connection handle to the database.

DB-Interact-Close

This subtask is used to close the connection with the database. It only requires the following input variable:

- i_db-handle

This is a structure input variable containing the connection handle to the database.

Installation Instructions

Download the Studio Package file and Import it into your Cortex Environment. Don't forget to apply rights using the Studio Authorization module.

👍 Enjoy! 😉

About

Subtasks to establish a database connection and return query output in desired format

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published