Create a function

suggest change
DELIMITER $$
CREATE
    DEFINER=`db_username`@`hostname_or_IP`
    FUNCTION `function_name`(optional_param data_type(length_if_applicable))
    RETURNS data_type
    DETERMINISTIC
BEGIN
    /*
    SQL statements go here
    */
END$$
DELIMITER ;

RETURNS names any MySQL data type. With binary logging enabled, MySQL rejects a function that has no characteristic such as DETERMINISTIC, NO SQL, or READS SQL DATA, unless log_bin_trust_function_creators is 1.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents