In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
DROP FUNCTION IF EXISTS rand_string Delimiter / / CREATE FUNCTION rand_string (l_num tinyint UNSIGNED L_type tinyint UNSIGNED) RETURNS varchar BEGIN-- Function: rand_string-- Author: dbachina#dbachina.com-- Date: 2010-5-30-- l_num: The length of random string-- l_type: The string type-- 1.0-9-- 2.a-z-- 3.A-Z-- 4.a-zA-Z-- 5.0-9aMuzaA- Z-mysql > select rand_string (12penny 5) random_string -1 row in set (0.00 sec) DECLARE i int UNSIGNED DEFAULT 0; DECLARE v_chars varchar (64) DEFAULT '0123456789; DECLARE result varchar'' IF l_type = 1 THEN SET v_chars = '0123456789; ELSEIF l_type = 2 THEN SET v_chars =' abcdefghijklmnopqrstuvwxyz'; ELSEIF l_type = 3 THEN SET v_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; ELSEIF l_type = 4 THEN SET v_chars =' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; ELSEIF l_type = 5 THEN SET v_chars = '0123456789 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQSTUVWXYZ; ELSE SET v_chars =' 0123456789; WHILE I < l_num DO SET result = concat (result,substr (rand () * (length (v_chars)-1)), 1)); SET I = I + 1; END WHILE; RETURN result;END;//delimiter; transferred from http://www.dbachina.com/2010/05/31/mysql_random_string_function/[@more@]
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.