Execute SQL Query

Perform an SQL query against a specified database and place the results into a variable. The query may be either predefined in Nintex Admin Tool or defined within the Advanced Command itself.

Supported Oracle version is v11 and later using OLEDBC v11 driver only.

Predefined queries are executed from the server and with the user configured in the “connection string” in Nintex Admin Tool, while custom queries in wizards are executed from the robot.

Predefined query

  1. Select the query you would like to perform from the available predefined queries.

    In predefined query, the builder and query were already configured in Nintex Admin Tool. See Managing SQL.

  2. Query Content and Parameters will be populated based upon the query you have selected.

  3. Specify Value and Type for defined parameters as required.

  4. Enter the name of the variable into which you'd like to place the results.

  5. Indicate whether you would like to return all rows of the result or the first row only; and

    Enter the delimiters to use to separate each row and column in the returned data.

  6. The DB provider is predefined in Nintex Admin Tool SQL configuration and can be changed only through Nintex Admin Tool.

  • When using a "like" operation in a predefined query, include a % at the end of the value.

    For example: SELECT * FROM [20.9].dbo.[LeoServers] WHERE ServerName LIKE '20.9%'

  • When using a variable in a query, it should be specified without the use of single quotes (' ') around the variable.

    For example: SELECT * FROM [20.9].dbo.[LeoServers] WHERE ServerName LIKE $test$

Custom query

  1. Define the connection string for the data source

    • (Optional) Click the Builder link to assist in defining the connection string.

  2. Indicate whether you would like to retrieve database login credentials from the Nintex Credentials Vault.

  3. Enter your query using standard SQL syntax.

  4. Select the relevant database provider (Default, Oracle, or SQL).

    Default: Let Nintex identify the provider.

    If you are using Oracle or SQL, we recommend you select the relevant database provider.

    Supported Oracle version is v11 and later using OLEDBC v11 driver only.

  5. Enter the name of the variable into which you'd like to place the results.

  6. Indicate whether you would like to return all rows of the result or the first row only; and

  7. Enter the delimiters to use to separate each row and column in the returned data.

  8. Expand the Error handling option to provide instructions to the wizard on how to manage encountered errors. For more information on error handling, see Error handling.