Get Data Securely(DB)

This is a pre-built Action located under the @Generic Element. The functionality of this Action in Avo Assure is to retrieve data from the Database table specified in the input. The result is stored in the given dynamic variable for further use during test execution.

Note: The DB password must be encrypted using the AES encryption method. For more information, click here.

Syntax

Input Value: <DB IP/instance name/DB file path>;<DB port>;<DB username>;<encrypted DB password>;<DB name>;<Query>;<DB Number/DB Tags>;<querytype/warehouse>(Optional);<schema>(Optional)

Argument
Description

<DB IP/instance name/DB file path> (Required)

Provide the Database server location, instance name, or DB file path you want to use for retrieving data.

<DB port> (Required)

Provide the port number you want to use for connecting with the Database.

<DB username> (Required)

Provide the username you want to use for Database access.

<encrypted DB password> (Required)

Provide the encrypted password associated with the username.

<DB name> (Required)

Provide the name of the Database you want to connect with.

<Query> (Required)

Provide the SQL or Non-SQL query you want to execute.

<DB Number/DB Tags> (Required)

Provide the Database identifier you want to use for the connection.

<querytype/warehouse> (Optional)

Provide the data container you want to target within the Database.

<schema> (Optional)

Provide the schema you want to use.

Note:

  • When providing the database connection details, you must provide the Database IP address, the instance name, or the Database file path in the input value

  • When you are providing the database identifier, you must provide the Database Number or the Database Tags in the input value, as required.

  • When you are using a non-SQL query, you must provide the querytype or the warehouse name in the input value.

Output Value: <Dynamic Variable>;<Dynamic Variable>(Optional)

Argument
Description

<Dynamic Variable> (Required)

This dynamic variable stores the data fetched from the Database.

<Dynamic Variable> (Optional)

This dynamic variable stores the status as True or False.

Example: Retrieving Data from a Database using the Get Data Securely Action

In this example, we explain how to retrieve data from a Database using the provided connection details and query.

  • Action: Get Data Securely(DB)

  • Input Value: sp-lively-glitter-a00wuaj6 pooler.eastus.azure.neon.tech;5432;John;FbSveCI31T0LIRLTdqsw==;Student;SELECT * FROM district WHERE district ILIKE 'Rajbari';14

    • The first argument (sp-lively-glitter-a00wuaj6-pooler.eastus.azure.neon.tech) specifies the Database server hostname.

    • The second argument (5432) specifies the port number used to establish the Database connection.

    • The third argument (John) specifies the Database username.

    • The fourth argument (FbSveCI31T0LIRLTdqsw==) specifies the encrypted password of the Database.

    • The fifth argument (Student) specifies the Database name.

    • The sixth argument (SELECT * FROM district WHERE district ILIKE 'Rajbari') contains the SQL query to execute.

    • The seventh argument (14) specifies the Database number used for execution.

  • Output Value: {DB_Data}

    • The retrieved data from the Database is stored in the {DB_Data} dynamic variable.

    • If a second output variable is defined, it stores the action status with the following possible values:

      • True: If the data is retrieved successfully.

      • False: If the data is not retrieved successfully.

  • Logical Explanation: The Get Data Securely(DB) action reads the value from the Input Value column (sp-lively-glitter-a00wuaj6 pooler.eastus.azure.neon.tech;5432;John;FbSveCI31T0LIRLTdqsw==;Student;SELECT * FROM district WHERE district ILIKE 'Rajbari';14). The action establishes a connection using the given Database credentials and executes the SQL query. The retrieved data is stored in the {DB_Data} variable.

Note: If you want to display the stored data, use the Display Variable Value action. In the Input Value column, provide the value in array format: {VariableName[row number][column number]}.

Last updated

Was this helpful?