DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `String_Split`( vString VARCHAR(8000), vSeparator VARCHAR(5) ) BEGIN DECLARE vDone tinyint(1) DEFAULT 1; DECLARE vIndex INT DEFAULT 1; DECLARE vSubString VARCHAR(15); DROP TABLE IF EXISTS tmpIDList; CREATE TEMPORARY TABLE tmpIDList (ID INT); WHILE vDone > 0 DO SET vSubString = SUBSTRING(vString, vIndex, IF(LOCATE(vSeparator, vString, vIndex) > 0, LOCATE(vSeparator, vString, vIndex) - vIndex, LENGTH(vString) )...
Comments
Post a Comment