From 8142239d32b66f40325500a5da045ffff1f4e842 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 11 Oct 2016 11:07:17 +0800 Subject: [PATCH] MOVED mysql/person_get_company.sql to mysql/core_person_get_company.sql --- mysql/core_person_get_company.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 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 ; -- 2.39.2