
CREATE DATABASE `sample`
	DEFAULT CHARACTER SET latin1
	DEFAULT COLLATE latin1_swedish_ci
GO

CREATE TABLE `sample`.`messages`  ( 
	`id`     	int(11) UNSIGNED ZEROFILL AUTO_INCREMENT COMMENT 'ID COLUMN'  NOT NULL,
	`message`	varchar(255) COMMENT 'MESSAGE COLUMN'  NOT NULL DEFAULT 'NULL',
	`time`   	timestamp COMMENT 'TIMESTAMP'  NULL,
	PRIMARY KEY(`id`)
)
COMMENT = 'Triggers result of exectuion is stored in this table' 
GO

CREATE PROCEDURE `sample`.`proc_insertion`  (IN `W_IN` int(11))
	SQL SECURITY DEFINER
	NOT DETERMINISTIC
	CONTAINS SQL
BEGIN
IF W_IN >= 0 THEN
    INSERT INTO `sample`.`messages`(`message`)
    VALUES('Procedure proc_insertion executed successfully');
END IF;
END
