<?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: NHibernate driver/dialect error in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaa-p/13841073#M4871916</link>
    <description>&lt;P&gt;I had this problem too!&lt;/P&gt;</description>
    <pubDate>Fri, 16 Nov 2012 04:54:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-11-16T04:54:52Z</dc:date>
    <item>
      <title>NHibernate driver/dialect error</title>
      <link>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaq-p/13841072</link>
      <description>&lt;P&gt;I'm using NHibernate (3.3.2.4000) to access my SA12 database.
Currently I have an linq expression that take sum of a column [type: numeric(19,2)] but sa server is throwing an exception since generated sql is something like&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="nb"&gt;select&lt;/SPAN&gt; &lt;SPAN class="n"&gt;sum&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;cast&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;value&lt;/SPAN&gt; &lt;SPAN class="n"&gt;as&lt;/SPAN&gt; &lt;SPAN class="n"&gt;numeric&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;19&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;255&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)))&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;I know numeric(19,255) is invalid. But now I have 2 questions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;How to solve / work around?&lt;/LI&gt;
&lt;LI&gt;Why using NHibernate 3.1.0.4000 with sa11 dialect it works?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 14:51:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaq-p/13841072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-14T14:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: NHibernate driver/dialect error</title>
      <link>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaa-p/13841073#M4871916</link>
      <description>&lt;P&gt;I had this problem too!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2012 04:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaa-p/13841073#M4871916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-16T04:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: NHibernate driver/dialect error</title>
      <link>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaa-p/13841074#M4871917</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Currently I have an linq expression that take sum of a column [type: numeric(19,2)]&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can you post the LINQ code that you're using to calculate this expression?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Why using NHibernate 3.1.0.4000 with sa11 dialect it works?&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Have you tried the SA12 dialect with NHibernate 3.1.0.4000 also? Do you see the same issue?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;How to solve / work around?&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you examine the &lt;A href="http://iablog.sybase.com/paulley/2009/07/new-sql-anywhere-11-nhibernate-dialect/"&gt;SQL Anywhere 11 Dialect code&lt;/A&gt; for how the dialect handles the NUMERIC type:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt; &lt;SPAN class="n"&gt;RegisterColumnType&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DbType&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;Decimal&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"NUMERIC(19,$l)"&lt;/SPAN&gt; &lt;SPAN class="p"&gt;);&lt;/SPAN&gt; &lt;SPAN class="sr"&gt;//&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Precision&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ranges&lt;/SPAN&gt; &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;0&lt;/SPAN&gt;&lt;SPAN class="o"&gt;-&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;127&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;and the (Java) Hibernate documentation describes how &lt;CODE&gt;$l&lt;/CODE&gt; (length, or scale) is &lt;A href="http://docs.jboss.org/hibernate/orm/3.5/api/org/hibernate/dialect/Dialect.html#registerColumnType%28int,%20java.lang.String%29"&gt;automatically passed in by the Hibernate framework&lt;/A&gt;. It's possible that this mechanism has changed somehow in 3.3.2.4000 - we'll need more details from you to help confirm this.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2012 13:25:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaa-p/13841074#M4871917</guid>
      <dc:creator>jeff_albion</dc:creator>
      <dc:date>2012-11-16T13:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: NHibernate driver/dialect error</title>
      <link>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaa-p/13841075#M4871918</link>
      <description>&lt;P&gt;Jeff, I'll analyze your questions and reply tomorrow.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2012 14:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nhibernate-driver-dialect-error/qaa-p/13841075#M4871918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-19T14:01:00Z</dc:date>
    </item>
  </channel>
</rss>

