Stored procedures
With the stored procedure provider it is possible to call a stored procedure in one of your databases when a record is created, updated, deleted or when a data import has been done.
Tutorial (video)On the bottom you can find the actual statement that will be executed on the database when the workflow is triggered. The Try now button on the top right will execute this statement directly to test the execution.
When the try button does not return an error the stored procedure is executed successfully.

Example in Postgresql
In this example we create a stored procedure that will consume 4 fields (user, status, accountmanager and sales_amount. It will write this data to a table `stored_procedure_data`.
CREATE TABLE
public.stored_procedure_data (
id SERIAL,
"user" character varying(255) NULL,
status character varying(255) NULL,
accountmanager character varying(255) NULL,
sales_amount character varying(255) NULL,
created_at timestamp(0) without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at timestamp(0) without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE OR REPLACE procedure (
"user" character varying,
"status" character varying,
"sales" character varying,
"name" character varying
)
language plpgsql
as $$
begin
INSERT INTO stored_procedure_data ("user", "status", "accountmanager", "sales_amount")
VALUES ("user", status, name, sales);
commit;
end;$$
Example in MySQL
CREATE TABLE
stored_procedure_data (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`user` VARCHAR(255) NULL,
`status` VARCHAR(255) NULL,
`accountmanager` VARCHAR(255) NULL,
`sales_amount` VARCHAR(255) NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DELIMITER //
CREATE PROCEDURE MyStoredProcedure (
IN user VARCHAR(255),
IN status VARCHAR(255),
IN sales VARCHAR(255),
IN name VARCHAR(255)
)
BEGIN
INSERT INTO stored_procedure_data (`user`, `status`, `accountmanager`, `sales_amount`)
VALUES (user, status, name, sales);
END //
DELIMITER ;
Last updated
Was this helpful?