Category: MySQL

MySQL Function

MySQL Function Create, call and drop MySQL function syntax and example. MySQL Create function syntax CREATE OR REPLACE FUNCTION function_name(parameter_name datatype) RETURNS datatype BEGIN function_body END; Create function example CREATE OR REPLACE FUNCTION function_test(p_id int) RETURNS TEXT BEGIN DECLARE v_name TEXT;...

MySQL Procedure

MySQL Procedure Create, call and drop MySQL procedure syntax and example. MySQL Create procedure syntax CREATE OR REPLACE PROCEDURE proc_name([ IN | OUT | INOUT ] parameter_name datatype) BEGIN procedure_body END; Create procedure example CREATE OR REPLACE PROCEDURE proc_test(IN p_id int,...

MySQL Drop trigger

MySQL Drop trigger To drop a trigger you can use the following command. MySQL Drop trigger syntax DROP TRIGGER trigger_name; Drop trigger example DROP TRIGGER test_trigger; Output trigger TEST_TRIGGER dropped....

MySQL Create trigger

MySQL Create trigger A trigger is a named database object that is associated with a table. MySQL Create trigger syntax CREATE TRIGGER trigger_name { BEFORE | AFTER } { INSERT | UPDATE | DELETE } ON table_name FOR EACH ROW {...