Use an SQL statement to extract the char in blob and convert it to a number and save it to another field bitsCN.com.
This requires a table structure, designed
But now we need to save the data in the 17, 18, and 19 fields in blob as numbers to the three new fields Gem1 Gem2 Gem3 added outside blob.
The following SQL statement can be used:
1. add three fields:
Alter table EquipmentInfo add Gem1 tinyint unsigned default 0;
Alter table EquipmentInfo add Gem2 tinyint unsigned default 0;
Alter table EquipmentInfo add Gem3 tinyint unsigned default 0;
2. use the following command to copy the data in blob
Update EquipmentInfo set Gem1 = conv (substr (HEX (EquipmentBlob), 17,2), 16,10), Gem2 = conv (substr (HEX (EquipmentBlob), 19,2), 16,10 ), gem3 = conv (substr (HEX (EquipmentBlob), 21,2), 16,10 );
Note:
HEX (EquipmentBlob) converts EquipmentBlob into a HEX string.
Substr (str, beginIdx, num) truncates str from the string starting with beginIdx. the truncation length is num.
Conv (N, from_base, to_base) N is the data to be converted, from_base is the original base, and to_base is the target base.
BitsCN.com