Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Hi everyone. Allow the procedures and / or functions of MariaDB to receive parameters like table name, view name, temporary table name, and / or field names, and that can be processed dynamically, for ACID operations and for declaration of cursors. For example:
CREATE PROCEDURE procedure1
(
p_tableName varchar(99),
p_fieldName varchar(99)
)
BEGIN
UPDATE @p_tableName SET @p_fieldName = @p_fieldName * 10;
INSERT INTO @p_tableName (@p_fieldName) VALUES (0);
DELETE FROM @p_tableName where (@p_fieldName)<1;
DECLARE myCursor CURSOR FOR SELECT @p_fieldName FROM @p_tableName;
END;
CALL procedure1('customers','bonus');
CALL procedure1('customers2','extra');
Thank yo so much.