MariaDB PL/SQL Examples

Table of Contents

Before you start

SQL> SET SESSION sql_mode='ORACLE';

Infinite Loop Example

DELIMITER /

BEGIN

LOOP
  SELECT 'Hello world from MariaDB anonymous PL/SQL block!';
END LOOP; 

END;
/

DELIMITER ;

Comments

I believe that the infinite loop example is just standard SQL. The only problem is that, in this context, BEGIN means START TRANSACTION. But you can use BEGIN NOT ATOMIC instead. A nice feature contributed by Antony Curtis.

Federico Razzoli comment

Is this not just a simple an Anonymous PL/SQL Block?

Shinguz comment