<?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>topic Re: error using st_point with stored procedure (works in sqldeveloper but not in java) in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/error-using-st-point-with-stored-procedure-works/m-p/1030636#M5769</link>
    <description>&lt;P&gt;This is still a question in 2021. I had the same issue today when using SDE.ST_POINT(). Turns out that the problem is related to&amp;nbsp;NLS_NUMERIC_CHARACTERS config.&lt;/P&gt;&lt;P&gt;SDE.ST_POINT will throw "&lt;SPAN&gt;Shape has too many parts"&amp;nbsp; if NLS_NUMERIC_CHARACTERS =",.". This is probably the case for&amp;nbsp;sde.ST_GeomFromText().&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To solve the issue, use&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;dbms_session.set_nls()&lt;/STRONG&gt; in the first line of the stored procedure or function as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create or replace PACKAGE BODY TEST_PACK AS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; procedure test as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&amp;nbsp;dbms_session.set_nls('NLS_NUMERIC_CHARACTERS', '".,"');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;insert into table_evw(shape) values (sde.ST_GeomFromText('point ('|| -73.16 || ' ' || 6.78&amp;nbsp; || ')', 4686));&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution found here: &lt;A title="StackOverflow" href="https://stackoverflow.com/questions/35024092/nls-numeric-characters-reset-when-accessed-from-weblogic-datasource" target="_blank" rel="noopener"&gt;StackOverflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Feb 2021 19:43:45 GMT</pubDate>
    <dc:creator>CarlosNantes</dc:creator>
    <dc:date>2021-02-25T19:43:45Z</dc:date>
    <item>
      <title>error using st_point with stored procedure (works in sqldeveloper but not in java)</title>
      <link>https://community.esri.com/t5/developers-questions/error-using-st-point-with-stored-procedure-works/m-p/682045#M4689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A simple procedure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create or replace PACKAGE BODY TEST_PACK AS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; procedure test as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert into table_evw(shape) values (sde.ST_GeomFromText('point ('|| -73.16 || ' ' || 6.78&amp;nbsp; || ')', 4686));&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END TEST_PACK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ran it in sqldeveloper:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TEST_PACK.test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;runs fine, i get a brand new record on 'table_evw'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i invoke it from java&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CallableStatement cs = c.prepareCall("{call test_pack.test}");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cs.executeQuery();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get this horrible exception&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORA-20004: Error generating shape from text: Shape has too many parts (-5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've already tried&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; alter instance set NLS_NUMERIC_CHARACTERS = ".,";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it doesnt work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oracle 11g.&lt;/P&gt;&lt;P&gt;ArcGIS 10.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 00:32:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/error-using-st-point-with-stored-procedure-works/m-p/682045#M4689</guid>
      <dc:creator>davidzornosa</dc:creator>
      <dc:date>2015-04-01T00:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: error using st_point with stored procedure (works in sqldeveloper but not in java)</title>
      <link>https://community.esri.com/t5/developers-questions/error-using-st-point-with-stored-procedure-works/m-p/1030636#M5769</link>
      <description>&lt;P&gt;This is still a question in 2021. I had the same issue today when using SDE.ST_POINT(). Turns out that the problem is related to&amp;nbsp;NLS_NUMERIC_CHARACTERS config.&lt;/P&gt;&lt;P&gt;SDE.ST_POINT will throw "&lt;SPAN&gt;Shape has too many parts"&amp;nbsp; if NLS_NUMERIC_CHARACTERS =",.". This is probably the case for&amp;nbsp;sde.ST_GeomFromText().&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To solve the issue, use&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;dbms_session.set_nls()&lt;/STRONG&gt; in the first line of the stored procedure or function as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create or replace PACKAGE BODY TEST_PACK AS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; procedure test as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&amp;nbsp;dbms_session.set_nls('NLS_NUMERIC_CHARACTERS', '".,"');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;insert into table_evw(shape) values (sde.ST_GeomFromText('point ('|| -73.16 || ' ' || 6.78&amp;nbsp; || ')', 4686));&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution found here: &lt;A title="StackOverflow" href="https://stackoverflow.com/questions/35024092/nls-numeric-characters-reset-when-accessed-from-weblogic-datasource" target="_blank" rel="noopener"&gt;StackOverflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 19:43:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/error-using-st-point-with-stored-procedure-works/m-p/1030636#M5769</guid>
      <dc:creator>CarlosNantes</dc:creator>
      <dc:date>2021-02-25T19:43:45Z</dc:date>
    </item>
  </channel>
</rss>

