<?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 Could not create function with ST_LINEFROMTEXT and ST_ASTEXT in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/could-not-create-function-with-st-linefromtext-and/m-p/478066#M3216</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm writing an oracle function to convert a ST_MULTILINESTRING to a ST_LINESTRING.&lt;/P&gt;&lt;P&gt;To reach that goal, the function would convert the input object to WKT format, then perform some modifications to resulting string and finally create the ST_LINESTRING:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;CREATE OR REPLACE FUNCTION MFICA_LINHA
&amp;nbsp; (MULTILINHA IN SDE.ST_MULTILINESTRING)
&amp;nbsp; RETURN SDE.ST_LINESTRING
IS
&amp;nbsp; LINHA SDE.ST_LINESTRING;
BEGIN
&amp;nbsp; SELECT SDE.ST_LINEFROMTEXT(replace(replace(replace(replace(SDE.ST_ASTEXT(MULTILINHA),'((','('),'),(',','),'))',')'),'MULTILINESTRING','LINESTRING'), 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO LINHA
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DUAL;
&amp;nbsp; RETURN LINHA;
END;&lt;/PRE&gt;&lt;P&gt;But it is getting the following error:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Error: PLS-00707: unsupported construct or internal error [2603]&lt;/PRE&gt;&lt;P&gt;Just to make sure that it youd work, I did:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT SDE.ST_LINEFROMTEXT(LINE_TEXT, 0) LINE
FROM (
&amp;nbsp; SELECT replace(replace(replace(replace(MLINE_TEXT, '((','('),'),(',','),'))',')'),'MULTILINESTRING','LINESTRING') LINE_TEXT
&amp;nbsp; FROM (
&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT SDE.ST_ASTEXT(MLINE) MLINE_TEXT
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM (
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT SDE.ST_MLINEFROMTEXT('MULTILINESTRING ((0 0, 1 1),(1 1, 2 2))', 0) MLINE
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DUAL
&amp;nbsp;&amp;nbsp;&amp;nbsp; )
&amp;nbsp; )
);&lt;/PRE&gt;&lt;P&gt;And I got a ST_SINGLELINE as expected.&lt;/P&gt;&lt;P&gt;In order to understand what would cause the creation funtion failure, I wrote a simpler version of the funciton:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;CREATE OR REPLACE FUNCTION MFICA_LINHA
&amp;nbsp; (MULTILINHA IN SDE.ST_MULTILINESTRING)
&amp;nbsp; RETURN SDE.ST_LINESTRING
IS
&amp;nbsp; LINHA SDE.ST_LINESTRING;
BEGIN
&amp;nbsp; SELECT SDE.ST_LINEFROMTEXT('', 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO LINHA
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DUAL;
&amp;nbsp; RETURN LINHA;
END;&lt;/PRE&gt;&lt;P&gt;Since it successful compiled, tryied:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;CREATE OR REPLACE FUNCTION MFICA_LINHA
&amp;nbsp; (MULTILINHA IN SDE.ST_MULTILINESTRING)
&amp;nbsp; RETURN SDE.ST_LINESTRING
IS
&amp;nbsp; LINHA SDE.ST_LINESTRING;
BEGIN
&amp;nbsp; SELECT SDE.ST_LINEFROMTEXT(SDE.ST_ASTEXT(MULTILINHA), 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO LINHA
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DUAL;
&amp;nbsp; RETURN LINHA;
END;&lt;/PRE&gt;&lt;P&gt;But I got the PLS-00707 error.&lt;/P&gt;&lt;P&gt;Why does my function creation fails, and why can't I use both ST_ASTEXT and ST_LINEFROMSTRING nestled?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:07:23 GMT</pubDate>
    <dc:creator>PlinioSantos</dc:creator>
    <dc:date>2021-12-11T21:07:23Z</dc:date>
    <item>
      <title>Could not create function with ST_LINEFROMTEXT and ST_ASTEXT</title>
      <link>https://community.esri.com/t5/developers-questions/could-not-create-function-with-st-linefromtext-and/m-p/478066#M3216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm writing an oracle function to convert a ST_MULTILINESTRING to a ST_LINESTRING.&lt;/P&gt;&lt;P&gt;To reach that goal, the function would convert the input object to WKT format, then perform some modifications to resulting string and finally create the ST_LINESTRING:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;CREATE OR REPLACE FUNCTION MFICA_LINHA
&amp;nbsp; (MULTILINHA IN SDE.ST_MULTILINESTRING)
&amp;nbsp; RETURN SDE.ST_LINESTRING
IS
&amp;nbsp; LINHA SDE.ST_LINESTRING;
BEGIN
&amp;nbsp; SELECT SDE.ST_LINEFROMTEXT(replace(replace(replace(replace(SDE.ST_ASTEXT(MULTILINHA),'((','('),'),(',','),'))',')'),'MULTILINESTRING','LINESTRING'), 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO LINHA
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DUAL;
&amp;nbsp; RETURN LINHA;
END;&lt;/PRE&gt;&lt;P&gt;But it is getting the following error:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Error: PLS-00707: unsupported construct or internal error [2603]&lt;/PRE&gt;&lt;P&gt;Just to make sure that it youd work, I did:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT SDE.ST_LINEFROMTEXT(LINE_TEXT, 0) LINE
FROM (
&amp;nbsp; SELECT replace(replace(replace(replace(MLINE_TEXT, '((','('),'),(',','),'))',')'),'MULTILINESTRING','LINESTRING') LINE_TEXT
&amp;nbsp; FROM (
&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT SDE.ST_ASTEXT(MLINE) MLINE_TEXT
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM (
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT SDE.ST_MLINEFROMTEXT('MULTILINESTRING ((0 0, 1 1),(1 1, 2 2))', 0) MLINE
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DUAL
&amp;nbsp;&amp;nbsp;&amp;nbsp; )
&amp;nbsp; )
);&lt;/PRE&gt;&lt;P&gt;And I got a ST_SINGLELINE as expected.&lt;/P&gt;&lt;P&gt;In order to understand what would cause the creation funtion failure, I wrote a simpler version of the funciton:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;CREATE OR REPLACE FUNCTION MFICA_LINHA
&amp;nbsp; (MULTILINHA IN SDE.ST_MULTILINESTRING)
&amp;nbsp; RETURN SDE.ST_LINESTRING
IS
&amp;nbsp; LINHA SDE.ST_LINESTRING;
BEGIN
&amp;nbsp; SELECT SDE.ST_LINEFROMTEXT('', 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO LINHA
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DUAL;
&amp;nbsp; RETURN LINHA;
END;&lt;/PRE&gt;&lt;P&gt;Since it successful compiled, tryied:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;CREATE OR REPLACE FUNCTION MFICA_LINHA
&amp;nbsp; (MULTILINHA IN SDE.ST_MULTILINESTRING)
&amp;nbsp; RETURN SDE.ST_LINESTRING
IS
&amp;nbsp; LINHA SDE.ST_LINESTRING;
BEGIN
&amp;nbsp; SELECT SDE.ST_LINEFROMTEXT(SDE.ST_ASTEXT(MULTILINHA), 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO LINHA
&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DUAL;
&amp;nbsp; RETURN LINHA;
END;&lt;/PRE&gt;&lt;P&gt;But I got the PLS-00707 error.&lt;/P&gt;&lt;P&gt;Why does my function creation fails, and why can't I use both ST_ASTEXT and ST_LINEFROMSTRING nestled?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:07:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/could-not-create-function-with-st-linefromtext-and/m-p/478066#M3216</guid>
      <dc:creator>PlinioSantos</dc:creator>
      <dc:date>2021-12-11T21:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Could not create function with ST_LINEFROMTEXT and ST_ASTEXT</title>
      <link>https://community.esri.com/t5/developers-questions/could-not-create-function-with-st-linefromtext-and/m-p/478067#M3217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The very same create function query which fails when using Oracle SQL Developer, works when I ran in SqlPlus.&lt;/P&gt;&lt;P&gt;So, it's a Oracle SQL Developler issue, 4.0.3.16 version.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 12:32:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/could-not-create-function-with-st-linefromtext-and/m-p/478067#M3217</guid>
      <dc:creator>PlinioSantos</dc:creator>
      <dc:date>2015-07-16T12:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Could not create function with ST_LINEFROMTEXT and ST_ASTEXT</title>
      <link>https://community.esri.com/t5/developers-questions/could-not-create-function-with-st-linefromtext-and/m-p/478068#M3218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="x1a"&gt;&lt;DIV&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" summary="" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD align="left"&gt;&lt;P&gt;&lt;SPAN class="xq" style="font-size: 14.3px; text-align: right; color: black; padding: 0 6px 0 0; font-weight: bold;"&gt;&lt;LABEL&gt;My Oracle Support&lt;/LABEL&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="xq" style="font-size: 14.3px; text-align: right; color: black; padding: 0 6px 0 0; font-weight: bold;"&gt;&lt;LABEL&gt;Compiling In SQL Developer Throws "PLS-00707: Unsupported Construct Or Internal Error" (Doc ID 1521171.1)&lt;/LABEL&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD align="right"&gt;&lt;A class="xfd" href="https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=8g7iub7af_9&amp;amp;_afrLoop=305089152492304" title="To Bottom"&gt;&lt;IMG alt="To Bottom" class="x137 jive-image" src="https://support.oracle.com/epmos/ui/images/quicklink_smlarrowdown_enabled.gif" style="border: none;" title="To Bottom" /&gt;&lt;SPAN class="x133" style="color: #003286; margin-left: 3px;"&gt;To Bottom&lt;/SPAN&gt;&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;IMG alt="" class="jive-image" height="10" src="https://support.oracle.com/epmos/adf/images/t.gif" width="20" /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;HR class="x1j" style="margin-top: 3px; margin-bottom: 3px; border-top-style: solid; border-top-color: #adb6c7; border-bottom-style: solid; border-bottom-color: #ffffff;" /&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="x1a xpj"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 100%;" summary=""&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV class="x1a"&gt;&lt;P&gt;&lt;STRONG&gt;In this Document&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="0"&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=8g7iub7af_9&amp;amp;_afrLoop=305089152492304#SYMPTOM"&gt;Symptoms&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="0"&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=8g7iub7af_9&amp;amp;_afrLoop=305089152492304#CAUSE"&gt;Cause&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="0"&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=8g7iub7af_9&amp;amp;_afrLoop=305089152492304#FIX"&gt;Solution&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;HR size="1" /&gt;&lt;P&gt;&lt;/P&gt;&lt;H2 class="km" style="font-family: Arial, Helvetica, sans-serif; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #c4d1e6; font-size: 16.25px; color: #ffffff; padding-top: 6px; padding-bottom: 6px; padding-left: 8px; background-color: #777773;"&gt;APPLIES TO:&lt;/H2&gt;&lt;SPAN class="kmContent" style="font-size: small; color: black;"&gt;&lt;SPAN class="kmContent" style="font-size: small; color: black;"&gt;Oracle SQL Developer - Version 3.2 and later&lt;BR /&gt;Information in this document applies to any platform.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;H2 class="km" style="font-family: Arial, Helvetica, sans-serif; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #c4d1e6; font-size: 16.25px; color: #ffffff; padding-top: 6px; padding-bottom: 6px; padding-left: 8px; background-color: #777773;"&gt;&lt;A name="SYMPTOM"&gt;&lt;/A&gt;SYMPTOMS&lt;/H2&gt;&lt;P&gt;sql developer version: 3.2.20.09&lt;BR /&gt;Database version: 11.2.0.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attempting to compile Function/Prucedure/Package in SQL Developer throws the following error:&lt;/P&gt;&lt;P&gt;PLS-00707: unsupported construct or internal error [2603]&lt;/P&gt;&lt;P&gt;This issue is not occuring in sqlplus. This issue occurs only for the 11g/11gr2 Database on SQL Developer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2 class="km" style="font-family: Arial, Helvetica, sans-serif; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #c4d1e6; font-size: 16.25px; color: #ffffff; padding-top: 6px; padding-bottom: 6px; padding-left: 8px; background-color: #777773;"&gt;&lt;A name="CAUSE"&gt;&lt;/A&gt;CAUSE&lt;/H2&gt;&lt;P&gt;It seems to be caused by the&amp;nbsp; parameter PL/SCOPE variable when it uses the value "IDENTIFIERS:ALL".&lt;BR /&gt;SQL Developer during connection establishing changes the session parameter PLSCOPE_SETTINGS from IDENTIFIERS:NONE (default) to IDENTIFIERS:ALL. &lt;BR /&gt;Same error was received in SQL PLUS when issuing an "alter session set PLSCOPE_SETTINGS=IDENTIFIERS:ALL".&lt;/P&gt;&lt;P&gt;More about PL/Scope can be found here:&lt;BR /&gt;&lt;A href="http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_plscope.htm"&gt;http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_plscope.htm&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams178.htm"&gt;http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams178.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2 class="km" style="font-family: Arial, Helvetica, sans-serif; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #c4d1e6; font-size: 16.25px; color: #ffffff; padding-top: 6px; padding-bottom: 6px; padding-left: 8px; background-color: #777773;"&gt;&lt;A name="FIX"&gt;&lt;/A&gt;SOLUTION&lt;/H2&gt;&lt;P&gt;1. Go to Preferences in SQL Developer.&lt;BR /&gt;2. Then go to Tools -&amp;gt; Preferences -&amp;gt; Database -&amp;gt; PL/SQL Compiler&lt;BR /&gt;3. Change the "PLScope identifiers" from All to None&lt;BR /&gt;4. Restart the SQL Developer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 18:25:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/could-not-create-function-with-st-linefromtext-and/m-p/478068#M3218</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2016-01-26T18:25:06Z</dc:date>
    </item>
  </channel>
</rss>

