set global log_bin_trust_function_creators=1; drop function if exists GetNum; CREATE FUNCTION GetNum (Varstring varchar(50)) RETURNS varchar(30) BEGIN DECLARE v_length INTDEFAULT 0; DECLARE v_Tmp varchar(50)default''; set v_length=CHAR_LENGTH(Varstring); WHILE v_length > 0 DO
if (ASCII(mid(Varstring,v_length,1))>47 andASCII(mid(Varstring,v_length,1))<58)then
set v_Tmp=concat(v_Tmp,mid(Varstring,v_length,1)); end if; SET v_length = v_length - 1; END WHILE; RETURN REVERSE(v_Tmp); END;