<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>KB-2038 Issues writing to MySQL database when emojis or unicode characters are used</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>KB-2038 Issues writing to MySQL database when emojis or unicode characters are used</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used</link><pubDate>Tue, 10 Dec 2019 02:03:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Parmida Borhani</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Current Revision posted to Appian Knowledge Base by Parmida Borhani on 12/10/2019 2:03:41 AM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store Entity smart service,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;&amp;lt;EXAMPLE_STRING&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;EXAMPLE_COLUMN&amp;gt;&amp;#39; at row 1&lt;br /&gt;ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;Work with a DBA to update the default collation on the database and on existing tables and columns. The following steps show one possible solution to this for MySQL databases:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take a backup of the database, including all database configurations and settings.&lt;/li&gt;
&lt;li&gt;Check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands:&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Confirm that the default collation should in fact be changed, and that changing it will not break any intended functionality.&lt;/li&gt;
&lt;li&gt;Run the following commands to manually set the default server level character set and collation:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will now inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;To identify which tables have columns that are using a character set, run the following query:
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;&amp;lt;schema_name&amp;gt;&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;When changing a character set, it is possible to have incompatibilities between the old and the new set. Make sure that the intended&amp;nbsp;character set&amp;nbsp;change will not cause new problems.&lt;br /&gt;&lt;br /&gt;The following is an example of an incompatibility that could result from changing the character set. The character set latin1 only takes one byte per character. The maximum index key length in MySQL is 767 bytes. So&amp;nbsp;a column with a latin1 character set&amp;nbsp;can have an index as long as the column limits to less than 767 characters. But utf8mb4 can take up to 4 bytes per character, which means that an index can only be set on a field that is a maximum of 767/4=191 characters. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. To work around this, three&amp;nbsp;possible options are to:&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index, change the character set, then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as-is, but recreate the index with a maximum key length of 191 characters only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Do nothing about the problem if changing the collation is more costly than enabling storage of emojis.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more information, see the&amp;nbsp;&lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-column.html"&gt;MySQL documentation for column character sets and collation&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt; that should have the collation changed, run:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:&amp;nbsp;December 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, emoji, mysql, application design, collation, infrastructure, unicode&lt;/div&gt;
</description></item><item><title>DRAFT - KB-XXXX - Issues writing to MySQL database when emojis or unicode characters are used</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/20</link><pubDate>Mon, 09 Dec 2019 05:56:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Parmida Borhani</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 20 posted to Appian Knowledge Base by Parmida Borhani on 12/9/2019 5:56:59 AM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store Entity smart service,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;&amp;lt;EXAMPLE_STRING&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;EXAMPLE_COLUMN&amp;gt;&amp;#39; at row 1&lt;br /&gt;ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;Work with a DBA to update the default collation on the database and on existing tables and columns. The following steps show one possible solution to this for MySQL databases:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take a backup of the database, including all database configurations and settings.&lt;/li&gt;
&lt;li&gt;Check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands:&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Confirm that the default collation should in fact be changed, and that changing it will not break any intended functionality.&lt;/li&gt;
&lt;li&gt;Run the following commands to manually set the default server level character set and collation:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will now inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;To identify which tables have columns that are using a character set, run the following query:
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;&amp;lt;schema_name&amp;gt;&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;When changing a character set, it is possible to have incompatibilities between the old and the new set. Make sure that the intended&amp;nbsp;character set&amp;nbsp;change will not cause new problems.&lt;br /&gt;&lt;br /&gt;The following is an example of an incompatibility that could result from changing the character set. The character set latin1 only takes one byte per character. The maximum index key length in MySQL is 767 bytes. So&amp;nbsp;a column with a latin1 character set&amp;nbsp;can have an index as long as the column limits to less than 767 characters. But utf8mb4 can take up to 4 bytes per character, which means that an index can only be set on a field that is a maximum of 767/4=191 characters. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. To work around this, three&amp;nbsp;possible options are to:&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index, change the character set, then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as-is, but recreate the index with a maximum key length of 191 characters only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Do nothing about the problem if changing the collation is more costly than enabling storage of emojis.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more information, see the&amp;nbsp;&lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-column.html"&gt;MySQL documentation for column character sets and collation&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt; that should have the collation changed, run:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:&amp;nbsp;December 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, emoji, mysql, collation, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - KB-XXXX - Issues writing to MySQL database when emojis or unicode characters are used</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/19</link><pubDate>Mon, 09 Dec 2019 05:56:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Parmida Borhani</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 19 posted to Appian Knowledge Base by Parmida Borhani on 12/9/2019 5:56:08 AM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store Entity smart service,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;Work with a DBA to update the default collation on the database and on existing tables and columns. The following steps show one possible solution to this for MySQL databases:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take a backup of the database, including all database configurations and settings.&lt;/li&gt;
&lt;li&gt;Check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands:&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Confirm that the default collation should in fact be changed, and that changing it will not break any intended functionality.&lt;/li&gt;
&lt;li&gt;Run the following commands to manually set the default server level character set and collation:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will now inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;To identify which tables have columns that are using a character set, run the following query:
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;&amp;lt;schema_name&amp;gt;&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;When changing a character set, it is possible to have incompatibilities between the old and the new set. Make sure that the intended&amp;nbsp;character set&amp;nbsp;change will not cause new problems.&lt;br /&gt;&lt;br /&gt;The following is an example of an incompatibility that could result from changing the character set. The character set latin1 only takes one byte per character. The maximum index key length in MySQL is 767 bytes. So&amp;nbsp;a column with a latin1 character set&amp;nbsp;can have an index as long as the column limits to less than 767 characters. But utf8mb4 can take up to 4 bytes per character, which means that an index can only be set on a field that is a maximum of 767/4=191 characters. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. To work around this, three&amp;nbsp;possible options are to:&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index, change the character set, then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as-is, but recreate the index with a maximum key length of 191 characters only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Do nothing about the problem if changing the collation is more costly than enabling storage of emojis.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more information, see the&amp;nbsp;&lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-column.html"&gt;MySQL documentation for column character sets and collation&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt; that should have the collation changed, run:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:&amp;nbsp;December 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, emoji, mysql, collation, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - KB-XXXX - Update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/18</link><pubDate>Fri, 06 Dec 2019 02:33:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Tom Ryan</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 18 posted to Appian Knowledge Base by Tom Ryan on 12/6/2019 2:33:04 AM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store node,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;Work with your DBA to update the default collation on the database and on existing tables and columns. The following steps show one possible solution to this for MySQL databases:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take a backup of the database, including all database configurations and settings.&lt;/li&gt;
&lt;li&gt;Check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands:&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Confirm that the default collation should in fact be changed, and that changing it will not break any intended functionality.&lt;/li&gt;
&lt;li&gt;Run the following commands to manually set the default server level character set and collation:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will now inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;To identify which tables have columns that are using a character set, run the following query:
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;&amp;lt;schema_name&amp;gt;&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;When changing a character set, it is possible to have incompatibilities between the old and the new set. Make sure that the intended&amp;nbsp;character set&amp;nbsp;change will not cause new problems.&lt;br /&gt;&lt;br /&gt;The following is an example of an incompatibility that could result from changing the character set. The character set latin1 only takes one byte per character. The maximum index key length in MySQL is 767 bytes. So&amp;nbsp;a column with a latin1 character set&amp;nbsp;can have an index as long as the column limits to less than 767 characters. But utf8mb4 can take up to 4 bytes per character, which means that an index can only be set on a field that is a maximum of 767/4=191 characters. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. To work around this, three&amp;nbsp;possible options are to:&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Do nothing about the problem if changing the collation is more costly than enabling storage of emojis.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more information, see the&amp;nbsp;&lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-column.html"&gt;MySQL documentation for column character sets and collation&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt; that should have the collation changed, run:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:&amp;nbsp;December 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - KB-XXXX - Update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/17</link><pubDate>Thu, 05 Dec 2019 19:54:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 17 posted to Appian Knowledge Base by Michael Haines on 12/5/2019 7:54:51 PM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store node,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;Work with your DBA to update the default collation on the database and on existing tables and columns:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take a backup of the database&lt;/li&gt;
&lt;li&gt;First check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands:&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Confirm that the default collation should in fact be changed, and that changing it will not break any intended functionality.&lt;/li&gt;
&lt;li&gt;Once this is confirmed, take a snapshot of the current settings before applying new changes in case the current settings need to restored later on.&lt;/li&gt;
&lt;li&gt;Run the following commands to manually set the default server level character set and collation:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Run this query to help identify which tables have columns that are using a character set:
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;When changing a character set, it is possible to have incompatibilities between the old and the new set. Make sure that the intended&amp;nbsp;character set&amp;nbsp;change will not cause new problems.&lt;br /&gt;&lt;br /&gt;The following is an example of an incompatibility that could result from changing the character set. The character set latin1 only takes one byte per character. The maximum index key length in mysql is 767 bytes. So&amp;nbsp;a column with a latin1 character set&amp;nbsp;can have an index as long as the column limits to less than 767 characters. But utf8mb4 can take up to 4 bytes per character, which means that an index can only be set on a field that is a maximum of 767/4=191 characters. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. To work around this, three&amp;nbsp;possible options are to:&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Do nothing about the problem if changing the collation is more costly than enabling storage of emojis.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more information, see the&amp;nbsp;&lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-column.html"&gt;MySQL documentation for column character sets and collation&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt; that should have the collation changed, run:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:&amp;nbsp;December 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - KB-XXXX - Update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/16</link><pubDate>Thu, 31 Oct 2019 00:13:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Parmida Borhani</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 16 posted to Appian Knowledge Base by Parmida Borhani on 10/31/2019 12:13:16 AM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store node,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;First check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands from phpMyAdmin:&lt;/span&gt;&lt;span style="font-size:inherit;"&gt;&lt;code&gt;&lt;span style="font-family:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Confirm that the default collation should in fact be changed, and that changing it will not break any intended functionality.&lt;/li&gt;
&lt;li&gt;Once this is confirmed, take a snapshot of the current settings before applying new changes in case the current settings need to restored later on.&lt;/li&gt;
&lt;li&gt;Run the following commands to manually set the default server level character set and collation:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;The remaining steps should be performed by the customer, not by Support. Run this query to help identify which tables have columns that are using a character set:
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;When changing a character set, it is possible to have incompatibilities between the old and the new set. For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that an index can only be set on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. To work around this, three options&amp;nbsp;could be:&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Do nothing about the problem if changing the collation is more costly than enabling storage of emojis.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt; that should have the collation changed, run:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - KB-XXXX - Update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/15</link><pubDate>Thu, 31 Oct 2019 00:12:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Parmida Borhani</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 15 posted to Appian Knowledge Base by Parmida Borhani on 10/31/2019 12:12:09 AM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store node,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;First check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands from phpMyAdmin:&lt;/span&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Confirm that the default collation should in fact be changed, and that changing it will not break any intended functionality.&lt;/li&gt;
&lt;li&gt;Once this is confirmed, take a snapshot of the current settings before applying new changes in case the current settings need to restored later on.&lt;/li&gt;
&lt;li&gt;Run the following commands to manually set the default server level character set and collation:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;The remaining steps should be performed by the customer, not by Support. Run this query to help identify which tables have columns that are using a character set:
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;When changing a character set, it is possible to have incompatibilities between the old and the new set. For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that an index can only be set on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. To work around this, three options&amp;nbsp;could be:&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Do nothing about the problem if changing the collation is more costly than enabling storage of emojis.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt; that should have the collation changed, run:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - KB-XXXX - Update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/14</link><pubDate>Wed, 30 Oct 2019 22:38:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 14 posted to Appian Knowledge Base by Michael Haines on 10/30/2019 10:38:57 PM&lt;br /&gt;
&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store node,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;First check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands from phpMyAdmin:&lt;/span&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Confirm that the default collation should in fact be changed, and that changing it will not break any intended functionality.&lt;/li&gt;
&lt;li&gt;Once this is confirmed, take a snapshot of the current settings before applying new changes in case the current settings need to restored later on.&lt;/li&gt;
&lt;li&gt;Run the following commands to manually set the default server level character set and collation:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;The remaining steps should be performed by the customer, not by Support. Run this query to help identify which tables have columns that are using a character set:
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;When changing a character set, it is possible to have incompatibilities between the old and the new set. For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that an index can only be set on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. To work around this, three options&amp;nbsp;could be:&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Do nothing about the problem if changing the collation is more costly than enabling storage of emojis.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt; that should have the collation changed, run:
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - KB-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/13</link><pubDate>Mon, 30 Sep 2019 13:31:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 13 posted to Appian Knowledge Base by Michael Haines on 9/30/2019 1:31:56 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store node,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;First check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands from phpMyAdmin:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Confirm that you would like to change the default collation, and that it changing it will not break any intended functionality. Once you have confirmed, take a snapshot of the current settings before applying new changes in case you need to restore them later on. Next, run the following commands to manually set the default server level character set and collation:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;It is possible that there might be an incompatibility&amp;nbsp;between two&amp;nbsp;old and new character sets. In this case,&amp;nbsp;you will need to decide&amp;nbsp;for&amp;nbsp;yourself what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, you could choose to do nothing about the problem if changing the collation is more costly than enabling storage of emojis. Run this query&amp;nbsp;to help identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/12</link><pubDate>Mon, 30 Sep 2019 13:31:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 12 posted to Appian Knowledge Base by Michael Haines on 9/30/2019 1:31:20 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store node,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;First check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands from phpMyAdmin:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Confirm that you would like to change the default collation, and that it changing it will not break any intended functionality. Once you have confirmed, take a snapshot of the current settings before applying new changes in case you need to restore them later on. Next, run the following commands to manually set the default server level character set and collation:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;It is possible that there might be an incompatibility&amp;nbsp;between two&amp;nbsp;old and new character sets. In this case,&amp;nbsp;you will need to decide&amp;nbsp;for&amp;nbsp;yourself what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, you could choose to do nothing about the problem if changing the collation is more costly than enabling storage of emojis. Run this query&amp;nbsp;to help identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/11</link><pubDate>Mon, 30 Sep 2019 13:30:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 11 posted to Appian Knowledge Base by Michael Haines on 9/30/2019 1:30:04 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the MySQL business database from a Write to Data Store node,&amp;nbsp;the following error is logged:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;First check the current default character set at different levels as well as the current default collation setting&amp;nbsp;for the MySQL database by running the following commands from phpMyAdmin:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Confirm that you would like to change the default collation, and that it changing it will not break any intended functionality. Once you have confirmed, take a snapshot of the current settings before applying new changes in case you need to restore them later on. Next, run the following commands to manually set the default server level character set and collation:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;It is possible that there might be an incompatibility&amp;nbsp;between two&amp;nbsp;old and new character sets. In this case,&amp;nbsp;you will need to decide&amp;nbsp;for&amp;nbsp;yourself what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, you could choose to do nothing about the problem, that it is more important to retain status quo than to support storing emojis. Run this query&amp;nbsp;to help identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/10</link><pubDate>Fri, 27 Sep 2019 20:37:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 10 posted to Appian Knowledge Base by Michael Haines on 9/27/2019 8:37:04 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the customer&amp;#39;s MySQL business database from a Write to Data Store node,&amp;nbsp;the customer encounters the following errors:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, first check the current default character set at different levels as well as the current default collation setting&amp;nbsp;by running the following commands:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If the default collation has already been set intentionally by the customer, then follow up with them to make sure that they would actually like the collation to be changed. Once you have confirmed, take a snapshot of the current settings before applying new changes in case you need to restore them later on. Next, run the following commands to manually set the default server level character set and collation:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do this themselves because something may not be compatible between two character sets. In this case, they will need to decide&amp;nbsp;for themselves what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, the customer could choose to do nothing about the problem.&amp;nbsp;This query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/9</link><pubDate>Fri, 27 Sep 2019 20:36:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 9 posted to Appian Knowledge Base by Michael Haines on 9/27/2019 8:36:19 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the customer&amp;#39;s MySQL business database from a Write to Data Store node,&amp;nbsp;the customer encounters the following errors:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, first check the current default character set at different levels as well as the current default collation setting&amp;nbsp;by running the following commands:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If the default collation has already been set intentionally by the customer, then follow up with them to make sure that they would actually like the collation to be changed. Once you have confirmed, take a snapshot of the current settings before applying new changes in case you need to restore them later on. Next, run the following commands to manually set the default server level character set and collation:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do this themselves because something may not be compatible between two character sets. In this case, they will need to decide&amp;nbsp;for themselves what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, the customer could choose to do nothing about the problem.&amp;nbsp;This query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/8</link><pubDate>Fri, 27 Sep 2019 20:35:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 8 posted to Appian Knowledge Base by Michael Haines on 9/27/2019 8:35:58 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to&amp;nbsp;write text containing emojis and certain other Unicode characters&amp;nbsp;to the customer&amp;#39;s MySQL business database from a Write to Data Store node,&amp;nbsp;the customer encounters the following error:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, first check the current default character set at different levels as well as the current default collation setting&amp;nbsp;by running the following commands:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If the default collation has already been set intentionally by the customer, then follow up with them to make sure that they would actually like the collation to be changed. Once you have confirmed, take a snapshot of the current settings before applying new changes in case you need to restore them later on. Next, run the following commands to manually set the default server level character set and collation:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do this themselves because something may not be compatible between two character sets. In this case, they will need to decide&amp;nbsp;for themselves what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, the customer could choose to do nothing about the problem.&amp;nbsp;This query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/7</link><pubDate>Fri, 27 Sep 2019 20:35:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 7 posted to Appian Knowledge Base by Michael Haines on 9/27/2019 8:35:12 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to store&amp;nbsp;text containing emojis and certain other Unicode characters in the customer&amp;#39;s MySQL business database from a Write to Data Store node,&amp;nbsp;the customer encounters the following error:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/charset-general.html"&gt;character set configuration of the MySQL database&lt;/a&gt; not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, first check the current default character set at different levels as well as the current default collation setting&amp;nbsp;by running the following commands:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select *&lt;br /&gt;from performance_schema.global_variables&lt;br /&gt;where variable_name like &amp;#39;%character%&amp;#39;&lt;br /&gt;or variable_name like &amp;#39;%collation%&amp;#39;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If the default collation has already been set intentionally by the customer, then follow up with them to make sure that they would actually like the collation to be changed. Once you have confirmed, take a snapshot of the current settings before applying new changes in case you need to restore them later on. Next, run the following commands to manually set the default server level character set and collation:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do this themselves because something may not be compatible between two character sets. In this case, they will need to decide&amp;nbsp;for themselves what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, the customer could choose to do nothing about the problem.&amp;nbsp;This query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/6</link><pubDate>Fri, 27 Sep 2019 18:22:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 6 posted to Appian Knowledge Base by Michael Haines on 9/27/2019 6:22:18 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to store&amp;nbsp;text containing emojis and certain other Unicode characters in the customer&amp;#39;s MySQL business database,&amp;nbsp;the customer encounters the following error:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default configuration of the MySQL database&amp;nbsp;not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, run&amp;nbsp;the following commands to manually set the default server level character set and collation:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do this themselves because something may not be compatible between two character sets. In this case, they will need to decide&amp;nbsp;for themselves what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, the customer could choose to do nothing about the problem.&amp;nbsp;This query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed: September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/5</link><pubDate>Thu, 26 Sep 2019 17:26:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 5 posted to Appian Knowledge Base by Michael Haines on 9/26/2019 5:26:52 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to store&amp;nbsp;text containing emojis and certain other Unicode characters in the customer&amp;#39;s MySQL business database,&amp;nbsp;the customer encounters the following error:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the default configuration of the MySQL database&amp;nbsp;not supporting the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, run&amp;nbsp;the following commands to manually set the default server level character set and collation:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default character set and collation.&amp;nbsp;However, any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do this themselves because something may not be compatible between two character sets. In this case, they will need to decide&amp;nbsp;for themselves what is the appropriate course of action.&amp;nbsp;For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters.&amp;nbsp;Two alternatives could be:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Or, the customer could choose to do nothing about the problem.&amp;nbsp;This query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/4</link><pubDate>Thu, 26 Sep 2019 17:23:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 4 posted to Appian Knowledge Base by Michael Haines on 9/26/2019 5:23:19 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to store&amp;nbsp;text containing emojis and certain other Unicode characters in the customer&amp;#39;s MySQL business database, they encounter the following error:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the MySQL database by default not being configured to support the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, run&amp;nbsp;the following SQL commands to manually set the default server level character set and collation:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default charater set and collation. But any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &amp;lt;table_name&amp;gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do it themselves because something may not be compatible between two character sets in which case they will need to decide what to do. For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. They will need to decide what to do in that case:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;The following query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type&lt;br /&gt;from information_schema.columns&lt;br /&gt;where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39;&lt;br /&gt;order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/3</link><pubDate>Thu, 26 Sep 2019 17:22:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 3 posted to Appian Knowledge Base by Michael Haines on 9/26/2019 5:22:38 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to store&amp;nbsp;text containing emojis and certain other Unicode characters in the customer&amp;#39;s MySQL business database, they encounter the following error:&lt;/p&gt;
&lt;pre&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/pre&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the MySQL database by default not being configured to support the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, run&amp;nbsp;the following SQL commands to manually set the default server level character set and collation:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;;&lt;br /&gt;set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default charater set and collation. But any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &amp;lt;table_name&amp;gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do it themselves because something may not be compatible between two character sets in which case they will need to decide what to do. For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. They will need to decide what to do in that case:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;The following query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type from information_schema.columns where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39; order by table_name, ordinal_position;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/2</link><pubDate>Thu, 26 Sep 2019 17:21:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 2 posted to Appian Knowledge Base by Michael Haines on 9/26/2019 5:21:29 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to store&amp;nbsp;text containing emojis and certain other Unicode characters in the customer&amp;#39;s MySQL business database, they encounter the following error:&lt;/p&gt;
&lt;p&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/p&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the MySQL database by default not being configured to support the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;On the customer&amp;#39;s MySQL database, run&amp;nbsp;the following SQL commands to manually set the default server level character set and collation:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;set global character_set_server = &amp;#39;utf8mb4&amp;#39;; set global collation_server = &amp;#39;utf8mb4_unicode_ci&amp;#39;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Any new tables created will inherit the default charater set and collation. But any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &amp;lt;table_name&amp;gt;, the customer should run:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;They need to do it themselves because something may not be compatible between two character sets in which case they will need to decide what to do. For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. They will need to decide what to do in that case:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;The following query will help them identify which tables have columns that are using a character set:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:inherit;font-size:inherit;"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type from information_schema.columns where character_set_name is not null and table_schema = &amp;#39;Appian&amp;#39; order by table_name, ordinal_position;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item><item><title>DRAFT - INT-XXXX - How to update MySQL collation to support emojis</title><link>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used/revision/1</link><pubDate>Thu, 26 Sep 2019 17:10:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4c2ff5-ba44-420c-b4ce-c298055ef798</guid><dc:creator>Michael Haines</dc:creator><comments>https://community.appian.com/support/w/kb/1559/kb-2038-issues-writing-to-mysql-database-when-emojis-or-unicode-characters-are-used#comments</comments><description>Revision 1 posted to Appian Knowledge Base by Michael Haines on 9/26/2019 5:10:56 PM&lt;br /&gt;
&lt;h2&gt;Symptom&lt;/h2&gt;
&lt;p&gt;When&amp;nbsp;attempting to store&amp;nbsp;text containing emojis and certain other Unicode characters in the customer&amp;#39;s MySQL business database, they encounter the following error:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;2019-08-22 06:56:39,213 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &amp;#39;blah&amp;#39; for column &amp;#39;blah&amp;#39; at row 1&lt;br /&gt;2019-08-22 06:56:39,214 [Appian Work Item - 75 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.type.external.writetodatastore.WriteToDataStoreCore - Error when trying to write to the data store. com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.duringWrite.userMsg=An error occurred while trying to write to the entity &amp;lt;entity&amp;gt; [id=&amp;lt;uuid&amp;gt;, type=&amp;lt;type&amp;gt; (id=&amp;lt;id&amp;gt;)] (data store: &amp;lt;data store&amp;gt;). Details: org.hibernate.exception.GenericJDBCException: could not insert: [&amp;lt;entity&amp;gt;]: java.sql.SQLException: Incorrect string value: &amp;#39;&amp;lt;value&amp;gt;&amp;#39; for column &amp;#39;&amp;lt;column&amp;gt;&amp;#39; at row &amp;lt;rownum&amp;gt; Data: TypedValue[it=&amp;lt;id&amp;gt;,v={&amp;lt;value&amp;gt;}&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;This is caused by the MySQL database by default not being configured to support the&amp;nbsp;full set of&amp;nbsp;unicode characters.&lt;/p&gt;
&lt;h2&gt;Action&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="code panel"&gt;
&lt;div class="codeContent panelContent"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On the customer&amp;#39;s MySQL database, run&amp;nbsp;the following SQL commands to manually set the default server level character set and collation:&lt;/p&gt;
&lt;div class="code panel"&gt;
&lt;div class="codeContent panelContent"&gt;
&lt;pre class="code-java"&gt;set global character_set_server = &lt;span class="code-quote"&gt;&amp;#39;utf8mb4&amp;#39;&lt;/span&gt;;
set global collation_server = &lt;span class="code-quote"&gt;&amp;#39;utf8mb4_unicode_ci&amp;#39;&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Any new tables created will inherit the default charater set and collation. But any tables that are already created with the previous character set and collation will not automatically switch their character set to the new one. The customer will need to do that explicitly themselves.&amp;nbsp;For each &lt;code&gt;&amp;lt;table_name&amp;gt;&lt;/code&gt;, the customer should run:&lt;/p&gt;
&lt;div class="code panel"&gt;
&lt;div class="codeContent panelContent"&gt;
&lt;pre class="code-java"&gt;alter table &amp;lt;table_name&amp;gt; convert to character set utf8mb4;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;They need to do it themselves because something may not be compatible between two character sets in which case they will need to decide what to do. For example, latin1 characters only take one byte per character. The maximum index key length in mysql is 767 bytes. So they can have an index on a character field that is 767 bytes. But utf8mb4 can take up to 4 bytes per character. Which means that you can have only have an index on a varchar field that is 767/4=191 characters only. The column length can be more than 191 characters but the index key length cannot be more than 191 characters. They will need to decide what to do in that case:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reduce the length of the column on which there is an index to 191 characters only. Drop the index. Change the character set. Then recreate the index.&lt;/li&gt;
&lt;li&gt;Keep the column length as it is but just recreate the index with a maximum key length of 191 chars only. This will work if the index is not unique. It will not work if the index is unique.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following query will help them identify which tables have columns that are using a character set:&lt;/p&gt;
&lt;div class="code panel"&gt;
&lt;div class="codeContent panelContent"&gt;
&lt;pre class="code-java"&gt;select table_name, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_set_name, collation_name, column_type
from   information_schema.columns
where  character_set_name is not &lt;span class="code-keyword"&gt;null&lt;/span&gt;
and    table_schema = &lt;span class="code-quote"&gt;&amp;#39;Appian&amp;#39;&lt;/span&gt;
order by table_name, ordinal_position;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;p&gt;Last Reviewed:September 2019&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, Cloud&lt;/div&gt;
</description></item></channel></rss>