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

diff --git a/mysql/core_person_get_name.sql b/mysql/core_person_get_name.sql
new file mode 100644 (file)
index 0000000..f25d4bc
--- /dev/null
@@ -0,0 +1,14 @@
+
+
+DROP FUNCTION IF EXISTS person_get_name;
+
+DELIMITER $$
+CREATE FUNCTION person_get_name(in_id INT(11))  RETURNS VARCHAR(254) DETERMINISTIC
+    BEGIN
+        
+        DECLARE v_ret VARCHAR(254);
+        SET v_ret= '';
+        SELECT name INTO v_ret  FROM Person WHERE id = in_id  LIMIT 1;
+        RETURN v_ret;
+    END $$
+DELIMITER ;
\ No newline at end of file