<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: [314]: numeric overflow ? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022753#M3202297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like a real overflow issue. The numeric data types on HANA do have limits - apparently those limits also apply to an aggregation function such as sum(). You find the maximum values for the supported data types on &lt;A href="http://help.sap.com/hana/html/_csql_data_types.html" title="http://help.sap.com/hana/html/_csql_data_types.html"&gt;http://help.sap.com/hana/html/_csql_data_types.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just choose a data type that can hold bigger values. I'll contact development to check if that limitation is intentional, because it looks like a bug to me...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--juergen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Sep 2012 00:51:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-09-27T00:51:04Z</dc:date>
    <item>
      <title>[314]: numeric overflow ?</title>
      <link>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaq-p/9022752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I try to understand ...&lt;/P&gt;&lt;P&gt;I want to aggregate some values, but i've got this error message :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;[314]: numeric overflow: search table error:&amp;nbsp; [6944] AttributeEngine: overflow in numeric calculation;JEAggregate pop1(setIndex('TEST:F_EXPORT','en'),setAttribute('MT_VALEUR'),setAggregationTypes(1))&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;SQL is :&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;select&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: 10pt;"&gt; cd_pays,&lt;/SPAN&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;sum&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;(mt_valeur) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;from&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt;"&gt; f_export&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;group&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;by&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; cd_pays&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt;"&gt;I work with AWS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt;"&gt;max() returns values..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 14:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaq-p/9022752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-26T14:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: [314]: numeric overflow ?</title>
      <link>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022753#M3202297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like a real overflow issue. The numeric data types on HANA do have limits - apparently those limits also apply to an aggregation function such as sum(). You find the maximum values for the supported data types on &lt;A href="http://help.sap.com/hana/html/_csql_data_types.html" title="http://help.sap.com/hana/html/_csql_data_types.html"&gt;http://help.sap.com/hana/html/_csql_data_types.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just choose a data type that can hold bigger values. I'll contact development to check if that limitation is intentional, because it looks like a bug to me...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--juergen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 00:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022753#M3202297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-27T00:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: [314]: numeric overflow ?</title>
      <link>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022754#M3202298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;would you mind posting your table definition? I still stick to my initial assumption, but after some testing I can say that it works fine (on Revision 36) at least for the data types I tested (tinyint with max_value = 255 and decimal(3) with max_value = 999) - this works fine and returns [A, 300]:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #941c64;"&gt;create&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;column&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;table&lt;SPAN style="color: #000000;"&gt; foobar(&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; foo &lt;SPAN style="color: #02208c;"&gt;varchar&lt;/SPAN&gt;(1),&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; bar tinyint&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;)&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #941c64;"&gt;insert&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;into&lt;SPAN style="color: #000000;"&gt; foobar &lt;/SPAN&gt;values&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #3a40f4;"&gt;'A'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,100)&lt;/SPAN&gt;&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #941c64;"&gt;insert&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;into&lt;SPAN style="color: #000000;"&gt; foobar &lt;/SPAN&gt;values&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #3a40f4;"&gt;'A'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,200)&lt;/SPAN&gt;&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #941c64;"&gt;select&lt;/SPAN&gt; foo,&lt;SPAN style="color: #941c64;"&gt;sum&lt;/SPAN&gt;(bar) &lt;SPAN style="color: #941c64;"&gt;from&lt;/SPAN&gt; foobar &lt;SPAN style="color: #941c64;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #941c64;"&gt;by&lt;/SPAN&gt; foo&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 03:52:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022754#M3202298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-27T03:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: [314]: numeric overflow ?</title>
      <link>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022755#M3202299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class="replyToName"&gt;Stéphane&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might have hit the upper limit of the datatype on column "mt_valeur" and the AttributeEngine gives you the numeric overflow error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need to alter the table column datatype to higher (for example from REAL to DOUBLE), or you can try another workaround with datatype conversion function (for example TO_DOUBLE) before the aggregation function:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: #000000 1px solid; padding: 2px;"&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;select&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;cd_pays,&lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt;"&gt;sum&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;(TO_DOUBLE(mt_valeur)) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;from&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt;"&gt;f_export&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;group&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-size: 10pt;"&gt;by&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; cd_pays&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 17:16:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022755#M3202299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-27T17:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: [314]: numeric overflow ?</title>
      <link>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022756#M3202300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Juergen, Ferry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're right Ferry, it's ok with to_double() &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/1011/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The max value is 69 943 708 731 and column is integer.&lt;/P&gt;&lt;P&gt;But it looks strange, Juergen's example is ok too on my side &lt;SPAN __jive_emoticon_name="plain" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" height="1" src="https://community.sap.com/1011/images/emoticons/plain.gif" width="1"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I share Juergen's point of view, it looks like a bug ...&lt;/P&gt;&lt;P&gt;My AWS's version is 1.00.28.361821&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Stéphane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 08:23:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022756#M3202300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-28T08:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: [314]: numeric overflow ?</title>
      <link>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022757#M3202301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stéphane,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously I used a stupid example - I'm quite sure that internally HANA will use a larger data type for tinyint, so the overflow doesn't happen. With integer, I get the numeric overflow. To keep data conversion as cheap as possible, I would cast to the next-bigger integer type which is bigint:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #941c64;"&gt;drop&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;table&lt;SPAN style="color: #000000;"&gt; foobar &lt;/SPAN&gt;cascade&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #941c64;"&gt;create&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;column&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;table&lt;SPAN style="color: #000000;"&gt; foobar(&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; foo &lt;SPAN style="color: #02208c;"&gt;varchar&lt;/SPAN&gt;(1),&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #02208c;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; bar &lt;/SPAN&gt;integer&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;)&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #941c64;"&gt;insert&lt;/SPAN&gt; &lt;SPAN style="color: #941c64;"&gt;into&lt;/SPAN&gt; foobar &lt;SPAN style="color: #941c64;"&gt;values&lt;/SPAN&gt;(&lt;SPAN style="color: #3a40f4;"&gt;'A'&lt;/SPAN&gt;,2147483647)&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #941c64;"&gt;insert&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;into&lt;SPAN style="color: #000000;"&gt; foobar &lt;/SPAN&gt;values&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #3a40f4;"&gt;'A'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,200)&lt;/SPAN&gt;&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;; does not work:&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="text-decoration: underline; color: #941c64;"&gt;select&lt;/SPAN&gt; foo,&lt;SPAN style="color: #941c64;"&gt;sum&lt;/SPAN&gt;(bar) &lt;SPAN style="color: #941c64;"&gt;from&lt;/SPAN&gt; foobar &lt;SPAN style="color: #941c64;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #941c64;"&gt;by&lt;/SPAN&gt; foo&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;; works:&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #941c64;"&gt;select&lt;/SPAN&gt; foo,&lt;SPAN style="color: #941c64;"&gt;sum&lt;/SPAN&gt;(to_bigint(bar)) &lt;SPAN style="color: #941c64;"&gt;from&lt;/SPAN&gt; foobar &lt;SPAN style="color: #941c64;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #941c64;"&gt;by&lt;/SPAN&gt; foo&lt;SPAN style="color: #4f78c4;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--juergen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 08:35:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022757#M3202301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-28T08:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: [314]: numeric overflow ?</title>
      <link>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022758#M3202302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 16:14:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/314-numeric-overflow/qaa-p/9022758#M3202302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-09-16T16:14:04Z</dc:date>
    </item>
  </channel>
</rss>

