Run query
Runs a database query using an existing or new database connection and saves the result in a data table
#
Designer Properties- Query The database query to be run on the connected database.
- Data Table The data table that will receive the result of the query.
#
Properties#
Input- Connection The connection opened using OpenConnection activity. We can either set the connection or create another using Provider Name and Connection String.
- Connection string Database connection string. As an example, for the example below the format is "Driver={PostgreSQL ODBC Driver(UNICODE)};Server=127.0.0.1;Port=5432;Database=postgres;UID=postgres;PWD=yourpassword"
- Provider Name The provider used to connect to the database. For instance, in the example below we use Odbc to connect to a postgres database.
- See Designer Properties above.
#
Database advanced- Command Type Sets how the command string is interpreted.
- Text Runs a query with the given parameters.
- StoreProcedure Calls the store procedure with the given sql parameters.
- TableDirect Returns all the content of a database table.
- Parameters A dictionary with all query parameters to be used by the sql query. The parameters must be specified as @parameter in the sql query and will be replaced at runtime with the value of the corresponding parameter from dictionary. To add/remove parameters just the ... button in properties window.
- Timeout in ms The maximum time to wait for the query to complete.
#
General PropertiesSee General Properties.
#
MiscSee Misc.
#
Out ErrorSee Out Error.
#
Output Properties- See Designer Properties above.
#
ExamplePlease check Open database connection example.