chunk_split for MySQL MariaDB

Need a chunk_split for MySQL? No procedures, no cursors. This hack is very specific for adding a space each octet in a 32 bit binary string. Test in your favorite SQL client: set @s32bit = ‘00000000000000001100001010100010’; select insert(insert(insert(@s32bit,9,0,‘ ‘),18,0,‘ ‘),27,0,‘ ‘); Example select string: select foo, blah, hex(bar) as ‘Hex’, insert(insert(insert(LPAD(CONV(hex(Db), 16, 2), 32, ‘0’),9,0,‘ ‘),18,0,‘ ‘),27,0,‘… Continue reading chunk_split for MySQL MariaDB

Published
Categorized as SQL