Execute Stored Procedures - Oracle to MariaDB Migration

In Oracle, you can execute a stored procedures from another stored procedure just specifying its name and parameters. In MariaDB Oracle Compatibility mode, you can use the same syntax, no need to use the CALL statement.

Oracle:

  -- Sample procedure with parameters 
  CREATE OR REPLACE PROCEDURE sp1(param1 VARCHAR2, param2 VARCHAR2)
  IS
     var1 VARCHAR2(60);
  BEGIN
    var1 := param1 || ', ' || param2 || '!';
  END;
  /
 
  -- Sample procedure without parameters 
  CREATE OR REPLACE PROCEDURE sp2
  IS
     var1 VARCHAR2(60);
  BEGIN
    var1 := 'Hello, world!';
  END;
  /
 
  -- Executing procedures from another procedure
  CREATE OR REPLACE PROCEDURE sp3
  IS
  BEGIN
    sp1('Hello', 'world');
 
    -- You can call the procedure without parameters without or with (), but CALL is required
    sp2();
    sp2;
  END;
  /

MariaDB - Oracle Compatibility:

  DELIMITER //
 
  CREATE OR REPLACE PROCEDURE sp3
  IS
  BEGIN
    sp1('Hello', 'world');
 
    -- You can call the procedure without parameters without or with ()
    sp2();
    sp2;
  END;
  //
 
  DELIMITER ;

Note that the CALL keyword is not required in MariaDB Oracle Compatibility mode.

For more information, see Oracle to MariaDB Migration - Oracle Compatibility Mode.