I have as table with this column and type:
sales_channel_id BINARY(16)
In the row I have this value: 5DBACA1114B24872ACCFE679037DF670
I have written this value into another table, but this time the table column has the type VARCHAR(255). In the table I see this value: 5dbaca1114b24872accfe679037df670 (no capitals).
Now I have created another table with a column of type BINARY(16). When I make something like this to transform the data from the varchar column to the new column like this:
INSERT INTO
setting_sales_channel (sales_channel_id)
SELECT sales_channel_id from mcn_setting
I get the error: Query 1 ERROR: Data too long for column 'sales_channel_id' at row 1
Why does this happen and how can I transfer the data from the VARCHAR column into the new column which is of type BINARY(16)?
UNHEX()? What you have is a 32 character long string, which will not fit into a 16 bytes long column.