Drop files here

SQL upload ( 0 ) x -

Page-related settings Click on the bar to scroll to top of page
Press Ctrl+Enter to execute query Press Enter to execute query
ascending
descending
Order:
Debug SQL
Count
Execution order
Time taken
Order by:
Group queries
Ungroup queries
Collapse Expand Show trace Hide trace Count : Time taken :
Options
Set default





Collapse Expand Requery Edit Explain Profiling Query failed Database : Queried time :
Browse mode
Customize browse mode.
Browse mode
Documentation Use only icons, only text or both. Restore default value
Documentation Use only icons, only text or both. Restore default value
Documentation Whether a user should be displayed a "show all (rows)" button. Restore default value
Documentation Number of rows displayed when browsing a result set. If the result set contains more rows, "Previous" and "Next" links will be shown. Restore default value
Documentation SMART - i.e. descending order for columns of type TIME, DATE, DATETIME and TIMESTAMP, ascending order otherwise. Restore default value
Documentation Highlight row pointed by the mouse cursor. Restore default value
Documentation Highlight selected rows. Restore default value
Documentation Restore default value
Documentation Restore default value
Documentation Repeat the headers every X cells, 0 deactivates this feature. Restore default value
Documentation Maximum number of characters shown in any non-numeric column on browse view. Restore default value
Documentation These are Edit, Copy and Delete links. Restore default value
Documentation Whether to show row links even in the absence of a unique key. Restore default value
Documentation Default sort order for tables with a primary key. Restore default value
Documentation When browsing tables, the sorting of each table is remembered. Restore default value
Documentation For display Options Restore default value
SELECT * FROM `proc`
[ Edit inline ] [ Edit ] [ Explain SQL ] [ Create PHP code ] [ Refresh ]
Full texts db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate
Edit Edit Copy Copy Delete Delete
DELETE FROM proc WHERE `proc`.`db` = 'udiiemu' AND `proc`.`name` = 'subStringCount' AND `proc`.`type` = 'FUNCTION'
udiiemu subStringCount FUNCTION subStringCount SQL CONTAINS_SQL YES DEFINER
sequence VARCHAR(8192), word VARCHAR(100)
int(4)
BEGIN
    DECLARE counter SMALLINT UNSIGNED DEFAULT 0;
    DECLARE word_length SMALLINT UNSIGNED;

    SET word_length = CHAR_LENGTH(word);

    WHILE (INSTR(sequence,word) != 0) DO
        SET counter = counter+1;
        SET sequence = SUBSTR(sequence, INSTR(sequence,word)+word_length);
    END WHILE;

    RETURN counter;
END
root@localhost 2016-12-05 22:02:24 2016-12-05 22:02:24 utf8 utf8_swedish_ci utf8_unicode_ci
BEGIN
    DECLARE counter SMALLINT UNSIGNED DEFAULT 0;
    DECLARE word_length SMALLINT UNSIGNED;

    SET word_length = CHAR_LENGTH(word);

    WHILE (INSTR(sequence,word) != 0) DO
        SET counter = counter+1;
        SET sequence = SUBSTR(sequence, INSTR(sequence,word)+word_length);
    END WHILE;

    RETURN counter;
END
NONE
Edit Edit Copy Copy Delete Delete
DELETE FROM proc WHERE `proc`.`db` = 'pncdimanager' AND `proc`.`name` = 'BASE64_DECODE' AND `proc`.`type` = 'FUNCTION'
pncdimanager BASE64_DECODE FUNCTION BASE64_DECODE SQL CONTAINS_SQL YES INVOKER
input BLOB
blob
BEGIN
	DECLARE ret BLOB DEFAULT '';
	DECLARE done TINYINT DEFAULT 0;

	IF input IS NULL THEN
		RETURN NULL;
	END IF;

each_block:
	WHILE NOT done DO BEGIN
		DECLARE accum_value BIGINT UNSIGNED DEFAULT 0;
		DECLARE in_count TINYINT DEFAULT 0;
		DECLARE out_count TINYINT DEFAULT 3;

each_input_char:
		WHILE in_count < 4 DO BEGIN
			DECLARE first_char CHAR(1);
	
			IF LENGTH(input) = 0 THEN
				RETURN ret;
			END IF;
	
			SET first_char = SUBSTRING(input,1,1);
			SET input = SUBSTRING(input,2);
	
			BEGIN
				DECLARE tempval TINYINT UNSIGNED;
				DECLARE error TINYINT DEFAULT 0;
				DECLARE base64_getval CURSOR FOR SELECT val FROM base64_data WHERE c = first_char;
				DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET error = 1;
	
				OPEN base64_getval;
				FETCH base64_getval INTO tempval;
				CLOSE base64_getval;

				IF error THEN
					ITERATE each_input_char;
				END IF;

				SET accum_value = (accum_value << 6) + tempval;
			END;

			SET in_count = in_count + 1;

			IF first_char = '=' THEN
				SET done = 1;
				SET out_count = out_count - 1;
			END IF;
		END; END WHILE;

		

		
		WHILE out_count > 0 DO BEGIN
			SET ret = CONCAT(ret,CHAR((accum_value & 0xff0000) >> 16));
			SET out_count = out_count - 1;
			SET accum_value = (accum_value << 8) & 0xffffff;
		END; END WHILE;
	
	END; END WHILE;

	RETURN ret;
END
root@localhost 2016-12-06 00:20:11 2016-12-06 00:20:11 utf8 utf8_swedish_ci utf8_unicode_ci
BEGIN
	DECLARE ret BLOB DEFAULT '';
	DECLARE done TINYINT DEFAULT 0;

	IF input IS NULL THEN
		RETURN NULL;
	END IF;

each_block:
	WHILE NOT done DO BEGIN
		DECLARE accum_value BIGINT UNSIGNED DEFAULT 0;
		DECLARE in_count TINYINT DEFAULT 0;
		DECLARE out_count TINYINT DEFAULT 3;

each_input_char:
		WHILE in_count < 4 DO BEGIN
			DECLARE first_char CHAR(1);
	
			IF LENGTH(input) = 0 THEN
				RETURN ret;
			END IF;
	
			SET first_char = SUBSTRING(input,1,1);
			SET input = SUBSTRING(input,2);
	
			BEGIN
				DECLARE tempval TINYINT UNSIGNED;
				DECLARE error TINYINT DEFAULT 0;
				DECLARE base64_getval CURSOR FOR SELECT val FROM base64_data WHERE c = first_char;
				DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET error = 1;
	
				OPEN base64_getval;
				FETCH base64_getval INTO tempval;
				CLOSE base64_getval;

				IF error THEN
					ITERATE each_input_char;
				END IF;

				SET accum_value = (accum_value << 6) + tempval;
			END;

			SET in_count = in_count + 1;

			IF first_char = '=' THEN
				SET done = 1;
				SET out_count = out_count - 1;
			END IF;
		END; END WHILE;

		

		
		WHILE out_count > 0 DO BEGIN
			SET ret = CONCAT(ret,CHAR((accum_value & 0xff0000) >> 16));
			SET out_count = out_count - 1;
			SET accum_value = (accum_value << 8) & 0xffffff;
		END; END WHILE;
	
	END; END WHILE;

	RETURN ret;
END
NONE
Edit Edit Copy Copy Delete Delete
DELETE FROM proc WHERE `proc`.`db` = 'pncdimanager' AND `proc`.`name` = 'BASE64_ENCODE' AND `proc`.`type` = 'FUNCTION'
pncdimanager BASE64_ENCODE FUNCTION BASE64_ENCODE SQL CONTAINS_SQL YES INVOKER
input BLOB
blob
BEGIN
	DECLARE ret BLOB DEFAULT '';
	DECLARE done TINYINT DEFAULT 0;

	IF input IS NULL THEN
		RETURN NULL;
	END IF;

each_block:
	WHILE NOT done DO BEGIN
		DECLARE accum_value BIGINT UNSIGNED DEFAULT 0;
		DECLARE in_count TINYINT DEFAULT 0;
		DECLARE out_count TINYINT;

each_input_char:
		WHILE in_count < 3 DO BEGIN
			DECLARE first_char CHAR(1);
	
			IF LENGTH(input) = 0 THEN
				SET done = 1;
				SET accum_value = accum_value << (8 * (3 - in_count));
				LEAVE each_input_char;
			END IF;
	
			SET first_char = SUBSTRING(input,1,1);
			SET input = SUBSTRING(input,2);
	
			SET accum_value = (accum_value << 8) + ASCII(first_char);

			SET in_count = in_count + 1;
		END; END WHILE;

		

		
		CASE
			WHEN in_count = 3 THEN SET out_count = 4;
			WHEN in_count = 2 THEN SET out_count = 3;
			WHEN in_count = 1 THEN SET out_count = 2;
			ELSE RETURN ret;
		END CASE;

		WHILE out_count > 0 DO BEGIN
			BEGIN
				DECLARE out_char CHAR(1);
				DECLARE base64_getval CURSOR FOR SELECT c FROM base64_data WHERE val = (accum_value >> 18);

				OPEN base64_getval;
				FETCH base64_getval INTO out_char;
				CLOSE base64_getval;

				SET ret = CONCAT(ret,out_char);
				SET out_count = out_count - 1;
				SET accum_value = accum_value << 6 & 0xffffff;
			END;
		END; END WHILE;

		CASE
			WHEN in_count = 2 THEN SET ret = CONCAT(ret,'=');
			WHEN in_count = 1 THEN SET ret = CONCAT(ret,'==');
			ELSE BEGIN END;
		END CASE;
	
	END; END WHILE;

	RETURN ret;
END
root@localhost 2016-12-06 00:20:17 2016-12-06 00:20:17 utf8 utf8_swedish_ci utf8_unicode_ci
BEGIN
	DECLARE ret BLOB DEFAULT '';
	DECLARE done TINYINT DEFAULT 0;

	IF input IS NULL THEN
		RETURN NULL;
	END IF;

each_block:
	WHILE NOT done DO BEGIN
		DECLARE accum_value BIGINT UNSIGNED DEFAULT 0;
		DECLARE in_count TINYINT DEFAULT 0;
		DECLARE out_count TINYINT;

each_input_char:
		WHILE in_count < 3 DO BEGIN
			DECLARE first_char CHAR(1);
	
			IF LENGTH(input) = 0 THEN
				SET done = 1;
				SET accum_value = accum_value << (8 * (3 - in_count));
				LEAVE each_input_char;
			END IF;
	
			SET first_char = SUBSTRING(input,1,1);
			SET input = SUBSTRING(input,2);
	
			SET accum_value = (accum_value << 8) + ASCII(first_char);

			SET in_count = in_count + 1;
		END; END WHILE;

		

		
		CASE
			WHEN in_count = 3 THEN SET out_count = 4;
			WHEN in_count = 2 THEN SET out_count = 3;
			WHEN in_count = 1 THEN SET out_count = 2;
			ELSE RETURN ret;
		END CASE;

		WHILE out_count > 0 DO BEGIN
			BEGIN
				DECLARE out_char CHAR(1);
				DECLARE base64_getval CURSOR FOR SELECT c FROM base64_data WHERE val = (accum_value >> 18);

				OPEN base64_getval;
				FETCH base64_getval INTO out_char;
				CLOSE base64_getval;

				SET ret = CONCAT(ret,out_char);
				SET out_count = out_count - 1;
				SET accum_value = accum_value << 6 & 0xffffff;
			END;
		END; END WHILE;

		CASE
			WHEN in_count = 2 THEN SET ret = CONCAT(ret,'=');
			WHEN in_count = 1 THEN SET ret = CONCAT(ret,'==');
			ELSE BEGIN END;
		END CASE;
	
	END; END WHILE;

	RETURN ret;
END
NONE
Edit Edit Copy Copy Delete Delete
DELETE FROM proc WHERE `proc`.`db` = 'udirmudevel' AND `proc`.`name` = 'getMask' AND `proc`.`type` = 'FUNCTION'
udirmudevel getMask FUNCTION getMask SQL CONTAINS_SQL YES DEFINER
`target` varchar(128), `pos` int(10)
char(1) CHARSET utf8 COLLATE utf8_unicode_ci
begin
 declare ret char(1);
 set ret=mid(target, pos,1);
 return ret;
end
root@localhost 2016-12-06 11:39:13 2016-12-06 11:39:13 NO_AUTO_VALUE_ON_ZERO utf8 utf8mb4_general_ci utf8_unicode_ci
begin
 declare ret char(1);
 set ret=mid(target, pos,1);
 return ret;
end
NONE
Edit Edit Copy Copy Delete Delete
DELETE FROM proc WHERE `proc`.`db` = 'udirmudevel' AND `proc`.`name` = 'setMask' AND `proc`.`type` = 'FUNCTION'
udirmudevel setMask FUNCTION setMask SQL CONTAINS_SQL YES DEFINER
`target` varchar(128), `pos` int(10), `val` char(1) 
char(128) CHARSET utf8 COLLATE utf8_unicode_ci
begin
 declare ret char(128);
 set ret=concat(mid(target, 1,pos-1),val,mid(target,pos+1,length(target)-pos));
 return ret;
end
root@localhost 2016-12-06 11:39:13 2016-12-06 11:39:13 NO_AUTO_VALUE_ON_ZERO utf8 utf8mb4_general_ci utf8_unicode_ci
begin
 declare ret char(128);
 set ret=concat(mid(target, 1,pos-1),val,mid(target,pos+1,length(target)-pos));
 return ret;
end
NONE
Edit Edit Copy Copy Delete Delete
DELETE FROM proc WHERE `proc`.`db` = 'udivibe' AND `proc`.`name` = 'computeWordFactor' AND `proc`.`type` = 'FUNCTION'
udivibe computeWordFactor FUNCTION computeWordFactor SQL CONTAINS_SQL YES DEFINER
validItems int,list varchar(1024)
double
begin

declare outResult double default 0.0;
declare idx INT DEFAULT 0;
declare maxIdx int default 0;
declare item int default 0;
declare finalItem double default 0.0;
declare factorOK double default 1.2;
declare factorFAILED double default -0.12;
declare lastItem int default 0;
declare difItem int default 0;
set list=concat(list,',','0');
set maxIdx= LENGTH(list)- LENGTH( REPLACE ( list, ",", "") );

while idx<maxIdx do
      set item=substring_index(SUBSTRING_INDEX(list, ',', idx+1),",",-1);
      set difItem=item-lastItem;
      set finalItem=if (difItem<=0,difItem*factorFAILED,factorOK/difItem);
      set outResult=outResult+finalItem;
      set idx=idx+1;
      set lastItem=item;
end while;
return validItems*outResult;
end
root@localhost 2016-12-06 00:24:19 2016-12-06 00:24:19 utf8 utf8_swedish_ci utf8_unicode_ci
begin

declare outResult double default 0.0;
declare idx INT DEFAULT 0;
declare maxIdx int default 0;
declare item int default 0;
declare finalItem double default 0.0;
declare factorOK double default 1.2;
declare factorFAILED double default -0.12;
declare lastItem int default 0;
declare difItem int default 0;
set list=concat(list,',','0');
set maxIdx= LENGTH(list)- LENGTH( REPLACE ( list, ",", "") );

while idx<maxIdx do
      set item=substring_index(SUBSTRING_INDEX(list, ',', idx+1),",",-1);
      set difItem=item-lastItem;
      set finalItem=if (difItem<=0,difItem*factorFAILED,factorOK/difItem);
      set outResult=outResult+finalItem;
      set idx=idx+1;
      set lastItem=item;
end while;
return validItems*outResult;
end
NONE
With selected: With selected:
Query results operations Copy to clipboard Copy to clipboard Export Export Display chart Display chart Create view Create view