From: Alan Knowles Date: Tue, 11 Oct 2016 03:07:17 +0000 (+0800) Subject: MOVED mysql/person_get_company.sql to mysql/core_person_get_company.sql X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=8142239d32b66f40325500a5da045ffff1f4e842 MOVED mysql/person_get_company.sql to mysql/core_person_get_company.sql --- diff --git a/mysql/core_person_get_company.sql b/mysql/core_person_get_company.sql new file mode 100644 index 00000000..a5dc09ec --- /dev/null +++ b/mysql/core_person_get_company.sql @@ -0,0 +1,15 @@ + +DROP FUNCTION IF EXISTS person_get_company; + +DELIMITER $$ +CREATE FUNCTION person_get_company( + in_id INT(11) + ) RETURNS INT(11) DETERMINISTIC + BEGIN + + DECLARE v_id INT(11); + SET v_id = 0; + SELECT company_id INTO v_id FROM Person WHERE id = in_id LIMIT 1; + RETURN v_id; + END $$ +DELIMITER ;