MariaDB - Create an event to call procedure

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

MariaDB - Create an event to call procedure

Postby WANTED42 » 09. March 2020 08:16

Hi

I know that in MariaDB, can create an event,
and to schedule the event to run daily.

If i having a procedure created.

Can i call my 'procedure' in event?

Example i having
Procedure 1
Procedure 2
(In SQL Server , we called Stored Procedure indeed)

Any sample refer?
WANTED42
 
Posts: 4
Joined: 09. March 2020 08:09
XAMPP version: 1
Operating System: 1

Re: MariaDB - Create an event to call procedure

Postby Nobbie » 09. March 2020 10:22

https://mariadb.com/kb/en/create-event/

Create Event ...
On ....
Do Call Procedure()
Last edited by Nobbie on 09. March 2020 10:30, edited 1 time in total.
Nobbie
 
Posts: 11565
Joined: 09. March 2008 13:04

Re: MariaDB - Create an event to call procedure

Postby WANTED42 » 09. March 2020 10:27

Thank replied.


Let say i having a 'stored procedure' in mariaDB
called doinsert()


Can i create event like below:-

CREATE EVENT insertData
ON SCHEDULE EVERY 1 HOUR
STARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH
ENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK
CALL doinsert;



Then the event will trigger PROCEDURE 'doInsert()'?
WANTED42
 
Posts: 4
Joined: 09. March 2020 08:09
XAMPP version: 1
Operating System: 1

Re: MariaDB - Create an event to call procedure

Postby Nobbie » 09. March 2020 10:31

See my posting, i added a simple example.
Nobbie
 
Posts: 11565
Joined: 09. March 2008 13:04

Re: MariaDB - Create an event to call procedure

Postby WANTED42 » 09. March 2020 10:39

Thank alot.
WANTED42
 
Posts: 4
Joined: 09. March 2020 08:09
XAMPP version: 1
Operating System: 1


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 3 guests