<?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-1115 GROUP_CONCAT function in MySQL truncates value</title><link>https://community.appian.com/support/w/kb/337/kb-1115-group_5f00_concat-function-in-mysql-truncates-value</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>KB-1115 GROUP_CONCAT function in MySQL truncates value</title><link>https://community.appian.com/support/w/kb/337/kb-1115-group_5f00_concat-function-in-mysql-truncates-value</link><pubDate>Thu, 09 Aug 2018 02:12:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02354272-2d8e-4d4e-a950-d32a650da021</guid><dc:creator>Parmida Borhani</dc:creator><comments>https://community.appian.com/support/w/kb/337/kb-1115-group_5f00_concat-function-in-mysql-truncates-value#comments</comments><description>Current Revision posted to Appian Knowledge Base by Parmida Borhani on 8/9/2018 2:12:29 AM&lt;br /&gt;
&lt;div class="row content_container"&gt; &lt;h2 id="symptoms"&gt;Symptoms&lt;/h2&gt; &lt;p&gt;When a view is using &lt;code&gt;GROUP_CONCAT&lt;/code&gt; function, the value is truncated in MySQL.&lt;/p&gt; &lt;h2 id="cause"&gt;Cause&lt;/h2&gt; &lt;p&gt;Mysql truncates to the maximum length that is given by the &lt;strong&gt;group_concat_max_len&lt;/strong&gt; system variable, which is a default value of 1024 bytes.&lt;/p&gt; &lt;p&gt;For more information, refer to &lt;a href="http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_group-concat"&gt;MySQL Documentation - GROUP_CONCAT(expr)&lt;/a&gt;.&lt;/p&gt; &lt;h2 id="action"&gt;Action&lt;/h2&gt; &lt;p&gt;To resolve this issue, use one of the following options:&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;For only self-managed installations, change the value of group_concat_max_len at runtime by doing the following (&lt;code&gt;val&lt;/code&gt; is an unsigned integer):&lt;/p&gt; &lt;pre&gt;SET [GLOBAL | SESSION] group_concat_max_len = val; &lt;/pre&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt;For both self-managed installations and cloud sites, modify the SQL for the view using a combination of &lt;code&gt;CONCAT&lt;/code&gt;and &lt;code&gt;GROUP_CONCAT&lt;/code&gt;.&lt;/p&gt; &lt;p&gt;Original Query:&lt;/p&gt; &lt;pre&gt;SELECT GROUP_CONCAT(last_name) FROM employee &lt;/pre&gt; &lt;p&gt;Modified Query:&lt;/p&gt; &lt;pre&gt;SELECT   SUBSTRING(     CONCAT(       GROUP_CONCAT(         IF(employee_id BETWEEN 1 AND 100, CONCAT(&amp;#39;,&amp;#39;, last_name), &amp;#39;&amp;#39;)         SEPARATOR &amp;#39;&amp;#39;       ),       GROUP_CONCAT(         IF(employee_id BETWEEN 101 AND 200, CONCAT(&amp;#39;,&amp;#39;, last_name), &amp;#39;&amp;#39;)         SEPARATOR &amp;#39;&amp;#39;       )     ),     2   ) AS result FROM employee &lt;/pre&gt; &lt;/li&gt; &lt;/ul&gt; &lt;h2 id="affected-versions"&gt;Affected Versions&lt;/h2&gt; &lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt; &lt;/div&gt; &lt;p&gt;Last Reviewed: April 2016&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, mysql, infrastructure&lt;/div&gt;
</description></item><item><title>KB-1115 GROUP_CONCAT function in MySQL truncates value</title><link>https://community.appian.com/support/w/kb/337/kb-1115-group_5f00_concat-function-in-mysql-truncates-value/revision/1</link><pubDate>Fri, 24 Feb 2017 13:31:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02354272-2d8e-4d4e-a950-d32a650da021</guid><dc:creator>Nick Vigilante</dc:creator><comments>https://community.appian.com/support/w/kb/337/kb-1115-group_5f00_concat-function-in-mysql-truncates-value#comments</comments><description>Revision 1 posted to Appian Knowledge Base by Nick Vigilante on 2/24/2017 1:31:50 PM&lt;br /&gt;
&lt;div class="row content_container"&gt;
&lt;h2 id="symptoms"&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;When a view is using &lt;code&gt;GROUP_CONCAT&lt;/code&gt; function, the value is truncated in MySQL.&lt;/p&gt;
&lt;h2 id="cause"&gt;Cause&lt;/h2&gt;
&lt;p&gt;Mysql truncates to the maximum length that is given by the &lt;strong&gt;group_concat_max_len&lt;/strong&gt; system variable, which is a default value of 1024 bytes.&lt;/p&gt;
&lt;p&gt;For more information, refer to &lt;a href="http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_group-concat"&gt;MySQL Documentation - GROUP_CONCAT(expr)&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="action"&gt;Action&lt;/h2&gt;
&lt;p&gt;To resolve this issue, use one of the following options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;For only on-premise installations, change the value of group_concat_max_len at runtime by doing the following (&lt;code&gt;val&lt;/code&gt; is an unsigned integer):&lt;/p&gt;
&lt;pre&gt;SET [GLOBAL | SESSION] group_concat_max_len = val;
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For both on-premise installations and cloud sites, modify the SQL for the view using a combination of &lt;code&gt;CONCAT&lt;/code&gt;and &lt;code&gt;GROUP_CONCAT&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Original Query:&lt;/p&gt;
&lt;pre&gt;SELECT GROUP_CONCAT(last_name) FROM employee
&lt;/pre&gt;
&lt;p&gt;Modified Query:&lt;/p&gt;
&lt;pre&gt;SELECT
  SUBSTRING(
    CONCAT(
      GROUP_CONCAT(
        IF(employee_id BETWEEN 1 AND 100, CONCAT(&amp;#39;,&amp;#39;, last_name), &amp;#39;&amp;#39;)
        SEPARATOR &amp;#39;&amp;#39;
      ),
      GROUP_CONCAT(
        IF(employee_id BETWEEN 101 AND 200, CONCAT(&amp;#39;,&amp;#39;, last_name), &amp;#39;&amp;#39;)
        SEPARATOR &amp;#39;&amp;#39;
      )
    ),
    2
  ) AS result
FROM employee
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="affected-versions"&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to all versions of Appian.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Last Reviewed: April 2016&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

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