getsetting.sql 257 B

1234567891011121314
  1. CREATE FUNCTION `getsetting`(
  2. a_name VARCHAR(50)
  3. ) RETURNS VARCHAR(100)
  4. DETERMINISTIC
  5. READS SQL DATA
  6. SQL SECURITY INVOKER
  7. BEGIN
  8. DECLARE t_value VARCHAR(100);
  9. SELECT IFNULL(value,'')
  10. INTO t_value
  11. FROM settings
  12. WHERE name = a_name;
  13. return t_value;
  14. END;