Export Multi-Value custom field result in DB error when label length is greater than 255 char.
custom field id xx is of multi-select (Alphanumeric) and having field length 255 char in DB. If we choose multiple option in select field (assuming total label length is greater than 255 char). (all multi-select option value length sum come under 255 charter but label length goes beyond that.)
When we export the data, label get stored in temporary table and same get exported.
During the Export process temporary table get created in database and column data length get decided on field length of custom field. in our case it was 255 charter but label goes around 300 character. When Data length is greater than size, query get failed.
To avoid such situation we can increase custom field size from 255 char to 512 char. and code for export need to changes, column length of temp. table will get adjusted based on custom field length.