Sample configuration of stored procedures for MariaDB

Use the following guidelines when you configure stored procedures for the MariaDB database.

Guidelines for configuring stored procedures

Use the MariaDB events to create new jobs for each stored procedure.

  • Schedule the jobs to run at least daily. You must schedule sp_runid to run atleast 10 minutes before the other scripts.
  • Create events for Unica Campaign database.

Example for creating a run identifier

The following example shows how to create a run identifier.

CREATE EVENT SP_RUNS
	ON SCHEDULE EVERY 1 DAY
    STARTS  '2020-11-20 20:30:00'
    DO
      CALL SP_RUNID();

Example for processing email contact data

The following example shows how to process email contact data. Schedule the job to run at least 10 minutes after the job that generates the run identifier.

CREATE EVENT EMAIL_CONTACT
	ON SCHEDULE EVERY 1 DAY
    STARTS  '2020-11-20 20:40:00'
    DO
      CALL SP_POPULATE_MAILING_CONTACTS(); 
 

Example for email response data

The following example shows how to process email response data. Schedule the job to run at least 10 minutes after the job that generates the run identifier.

CREATE EVENT EMAIL_RESPONSE
	ON SCHEDULE EVERY 1 DAY
    STARTS  '2020-11-20 20:40:00'
    DO
      CALL SP_POPULATE_MAILING_RESPONSES(); 
 

Example for processing SMS contact data

The following example shows how to process SMS contact data. Schedule the job to runat least 10 minutes after the job that generates the run identifier.

CREATE EVENT SMS_CONTACT
	ON SCHEDULE EVERY 1 DAY
    STARTS  '2020-11-20 20:40:00'
    DO
      CALL SP_POPULATE_SMS_CONTACTS();
 

Example for processing SMS response data

The following example shows how to process SMS response data. Schedule the job to runat least 10 minutes after the job that generates the run identifier.

CREATE EVENT SMS_RESPONSE
	ON SCHEDULE EVERY 1 DAY
    STARTS  '2020-11-20 20:40:00'
    DO
      CALL SP_POPULATE_SMS_RESPONSES(); 

Example for processing WhatsApp contact data

The following example shows how to process WhatsApp contact data. Schedule the job to runat least 10 minutes after the job that generates the run identifier.

CREATE EVENT WHTSAPP_CONTACT
	ON SCHEDULE EVERY 1 DAY
    STARTS  '2020-11-20 20:40:00'
    DO
      CALL SP_POPULATE_WHTSAPP_CONTACTS();
 

Example for processing WhatsApp response data

The following example shows how to process WhatsApp response data. Schedule the job to runat least 10 minutes after the job that generates the run identifier.

CREATE EVENT WHTSAPP_RESPONSE
	ON SCHEDULE EVERY 1 DAY
    STARTS  '2020-11-20 20:40:00'
    DO
      CALL SP_POPULATE_WHTSAPP_RESPONSES(); 

Example for processing Mobile response data

The following example shows how to process Mobile response data. Schedule the job to runat least 10 minutes after the job that generates the run identifier.

CREATE EVENT MOBILE_RESPONSE
	ON SCHEDULE EVERY 1 DAY
    STARTS  '2020-11-20 20:40:00'
    DO
      CALL SP_POPULATE_MOBILE_RESPONSES();