Manage stored procedure action

Use the Manage stored procedure action in the Database package to create, update, and delete a stored procedure within the specified database. A stored procedure is SQL code saved to the database, enabling you to run it repeatedly.

Settings

  • In the Session name field, enter the name of the session that you used to connect to the database server in the Connect action.
  • In the Enter full command field, enter the command to create, update, or delete the stored procedure. You can specify input and output parameters for the command; you provide values or variables holding the values in the Run stored procedure action.
    Note: Declare a delimiter and use it to close the SQL statement.
    MySQL example: In this example, the bot checks if there is a procedure in the database named sum_of_two. If not, the bot creates a procedure that accepts two input parameters (num1 and num2), adds them together, and produces the sum as the output parameter:
     DROP PROCEDURE IF EXISTS sum_of_two;
        DELIMITER $
            CREATE PROCEDURE sum_of_two(IN num1 INT,IN num2 INT,OUT sum INT)
            BEGIN
                SET sum := num1 + num2;
        END
        $
  • In the Timeout for the query in seconds field, specify the time within which the statement execution should stop, even if the execution is not completed.