MOVED mysql/company_get_owner_name.sql to mysql/core_company_get_owner_name.sql
authorAlan Knowles <alan@roojs.com>
Tue, 11 Oct 2016 03:05:20 +0000 (11:05 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 11 Oct 2016 03:05:20 +0000 (11:05 +0800)
mysql/core_company_get_owner_name.sql [new file with mode: 0644]

diff --git a/mysql/core_company_get_owner_name.sql b/mysql/core_company_get_owner_name.sql
new file mode 100644 (file)
index 0000000..07a2149
--- /dev/null
@@ -0,0 +1,12 @@
+
+DROP FUNCTION IF EXISTS company_get_owner_name;
+DELIMITER $$
+CREATE FUNCTION company_get_owner_name()  RETURNS VARCHAR(254) DETERMINISTIC
+    BEGIN
+        DECLARE v_ret VARCHAR(254);
+        SET v_ret= '';
+        SELECT name INTO v_ret  FROM Companies WHERE isOwner = 1 LIMIT 1;
+        RETURN v_ret;
+    END $$
+DELIMITER ;
\ No newline at end of file