daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DROP FUNCTION IF EXISTS SPLIT_STRING;
  2.  
  3. DELIMITER //
  4.  
  5. CREATE FUNCTION SPLIT_STRING(str VARCHAR(255), delim VARCHAR(12), pos INT)
  6. BEGIN
  7. RETURNS VARCHAR(255)
  8. RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(str, delim, pos),
  9.        LENGTH(SUBSTRING_INDEX(str, delim, pos-1)) + 1),
  10.        delim, '');
  11. END//
  12.  
  13. GRANT EXECUTE ON PROCEDURE wp_fishdev.SPLIT_STRING TO 'root'@'localhost';
  14. GRANT EXECUTE ON PROCEDURE wp_fishdev.SPLIT_STRING TO 'root'@'127.0.0.1';
  15.  
  16. DELIMITER ;
RAW Paste Data
Top