<?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: Sybase SA12, 16: Error query optimization with UDF in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829790#M4860633</link>
    <description>&lt;P&gt;The 'correlation name not found' error appears to be a bug introduced with a previous change in this area. Thanks for the bug report, CR# 751771 has been opened to address this issue.
To work around this issue, you can change the function definition of FTest1 to &lt;CODE&gt;NOT DETERMINISTIC&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2013 13:04:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-11-25T13:04:37Z</dc:date>
    <item>
      <title>Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaq-p/13829789</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;There are two tables:&lt;/P&gt;
&lt;HR /&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TABLE&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"DBA"&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"TEST1"&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;
        &lt;SPAN class="s"&gt;"ID1"&lt;/SPAN&gt; &lt;SPAN class="n"&gt;INTEGER&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="s"&gt;"CSTR"&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CHAR&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;10&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;PRIMARY&lt;/SPAN&gt; &lt;SPAN class="n"&gt;KEY&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"ID1"&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ASC&lt;/SPAN&gt; &lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="p"&gt;);&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;and&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TABLE&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"DBA"&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"TEST2"&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;
        &lt;SPAN class="s"&gt;"ID2"&lt;/SPAN&gt; &lt;SPAN class="n"&gt;INTEGER&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="s"&gt;"SUBITEM"&lt;/SPAN&gt; &lt;SPAN class="n"&gt;INTEGER&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="s"&gt;"ORGANIZNAME"&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CHAR&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;180&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;PRIMARY&lt;/SPAN&gt; &lt;SPAN class="n"&gt;KEY&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"ID2"&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ASC&lt;/SPAN&gt; &lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="p"&gt;);&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;HR /&gt;
&lt;P&gt;There are two UDF:
query - with ... select&lt;/P&gt;
&lt;HR /&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;FUNCTION&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dba&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;FTest1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;in&lt;/SPAN&gt; &lt;SPAN class="n"&gt;nVal&lt;/SPAN&gt; &lt;SPAN class="n"&gt;integer&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;RETURNS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Long&lt;/SPAN&gt; &lt;SPAN class="n"&gt;VarChar&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;DETERMINISTIC&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;BEGIN&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;DECLARE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ret&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Long&lt;/SPAN&gt; &lt;SPAN class="n"&gt;VarChar&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;

 &lt;SPAN class="n"&gt;with&lt;/SPAN&gt; &lt;SPAN class="n"&gt;recursive&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CHECK1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ID2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;SUBITEM&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="n"&gt;as&lt;/SPAN&gt; 
 &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;
 &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="nb"&gt;select&lt;/SPAN&gt; 
   &lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ID2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; 
   &lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;SUBITEM&lt;/SPAN&gt; 
  &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dba&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;
  &lt;SPAN class="n"&gt;where&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ID2&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;nVal&lt;/SPAN&gt;
  &lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;union&lt;/SPAN&gt; &lt;SPAN class="n"&gt;all&lt;/SPAN&gt;
 &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="nb"&gt;select&lt;/SPAN&gt; 
   &lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ID2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; 
   &lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;SUBITEM&lt;/SPAN&gt; 
  &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dba&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;
  &lt;SPAN class="nb"&gt;join&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CHECK1&lt;/SPAN&gt; &lt;SPAN class="n"&gt;on&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;SUBITEM&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CHECK1&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ID2&lt;/SPAN&gt; &lt;SPAN class="ow"&gt;and&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;SUBITEM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;is&lt;/SPAN&gt; &lt;SPAN class="ow"&gt;not&lt;/SPAN&gt; &lt;SPAN class="n"&gt;null&lt;/SPAN&gt;&lt;SPAN class="p"&gt;))&lt;/SPAN&gt;  
 &lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="nb"&gt;select&lt;/SPAN&gt; &lt;SPAN class="n"&gt;LIST&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ID2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="n"&gt;into&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ret&lt;/SPAN&gt; &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CHECK1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;

 &lt;SPAN class="n"&gt;RETURN&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ret&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;END&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;go&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;HR /&gt;
&lt;P&gt;and simple query&lt;/P&gt;
&lt;HR /&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;FUNCTION&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dba&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;FTest2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;in&lt;/SPAN&gt; &lt;SPAN class="n"&gt;nVal&lt;/SPAN&gt; &lt;SPAN class="n"&gt;integer&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;RETURNS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Long&lt;/SPAN&gt; &lt;SPAN class="n"&gt;VarChar&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;DETERMINISTIC&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;BEGIN&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;DECLARE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ret&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Long&lt;/SPAN&gt; &lt;SPAN class="n"&gt;VarChar&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="nb"&gt;select&lt;/SPAN&gt; &lt;SPAN class="n"&gt;LIST&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ID2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="n"&gt;into&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ret&lt;/SPAN&gt; &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dba&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;TEST2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;RETURN&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ret&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;END&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;go&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;HR /&gt;
&lt;P&gt;Perform in ISQL for Sybase SA 12.0.1.3924 (and younger) 
or Sybase SA 16.0.0.1324 request:&lt;/P&gt;
&lt;HR /&gt;
&lt;H2&gt;select dba.FTest1(TEST1.ID1) from dba.TEST1&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;all executed without error.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Perform in ISQL for Sybase SA 12.0.1.3942 (or higher) or on
Sybase SA 16.0.0.1644 the same request:&lt;/P&gt;
&lt;HR /&gt;
&lt;H2&gt;select dba.FTest1(TEST1.ID1) from dba.TEST1&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;when the error occurs:
Could not execute statement.
The correlation name 'TEST1' not found
SQLCODE=-142, ODBC 3 State="42S02"
Line 1, column 1&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;While, if the same request to other UDF:&lt;/P&gt;
&lt;HR /&gt;
&lt;H2&gt;select dba.FTest2(TEST1.ID1) from dba.TEST1&lt;/H2&gt;
&lt;P&gt;perform at Sybase SA 12.0.1.3942 (or higher) or at Sybase SA 16.0.0.1644 
the error does not occur.
The only difference here is that in dba.FTest1 query "with ... select", 
and in dba.FTest2 request without "with ... select".
The same error does not occur if, instead dba.FTest1 (TEST1.ID1)
perform dba.FTest1(&amp;lt;any number=""&amp;gt;).&lt;/P&gt;
&lt;P&gt;Q: Why is this error has been happening in recent versions of 
Sybase SA 12.x and 16.x ? 
This is a bug in the Sybase SA or is it my fault ?
Indeed, in earlier versions of Sybase SA 12.x and 16.x query 
dba.FTest1 (TEST1.ID1) without errors.&lt;/P&gt;
&lt;P&gt;I noticed one more thing:
when the query&lt;/P&gt;
&lt;HR /&gt;
&lt;H2&gt;select TEST1.ID1 as X1, dba.FTest1(X1) from dba.TEST1&lt;/H2&gt;
&lt;P&gt;I receive an error:
Could not execute statement.
The column 'X1' not found
SQLCODE=-143, ODBC 3 State="42S22"
Line 1, column 1&lt;/P&gt;
&lt;P&gt;This error occurs on all versions Sybase SA 12.x and 16.x.
Although the same request to another UDF&lt;/P&gt;
&lt;HR /&gt;
&lt;H2&gt;select TEST1.ID1 as X1, dba.FTest2(X1) from dba.TEST1&lt;/H2&gt;
&lt;P&gt;without errors.&lt;/P&gt;
&lt;P&gt;Again, it is not clear why in the case dba.FTest1 column 'X1' was not found.
Why this error happens ?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 07:15:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaq-p/13829789</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2013-11-25T07:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829790#M4860633</link>
      <description>&lt;P&gt;The 'correlation name not found' error appears to be a bug introduced with a previous change in this area. Thanks for the bug report, CR# 751771 has been opened to address this issue.
To work around this issue, you can change the function definition of FTest1 to &lt;CODE&gt;NOT DETERMINISTIC&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 13:04:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829790#M4860633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-11-25T13:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829793#M4860636</link>
      <description>&lt;P&gt;&lt;STRONG&gt;2 Mikel Rychliski&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Thanks for the answer.&lt;/P&gt;
&lt;P&gt;And what can you say about the error
"The column not found" in the query&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;TEST1&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ID1&lt;/SPAN&gt; &lt;SPAN class="n"&gt;as&lt;/SPAN&gt; &lt;SPAN class="n"&gt;X1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dba&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;FTest1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;X1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dba&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;TEST1&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;Or the same reason these errors as they arise ?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 03:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829793#M4860636</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2013-11-26T03:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829794#M4860637</link>
      <description>&lt;P&gt;In Sybase SA EBF 22109: 12.0.1 SP66 Build 3994 these errors not corrections.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 09:41:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829794#M4860637</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2013-12-11T09:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829795#M4860638</link>
      <description>&lt;P&gt;This bug was has not been fixed as of build 3994, but will be available in a future EBF/SP.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 09:54:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829795#M4860638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-11T09:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829791#M4860634</link>
      <description>&lt;P&gt;This bug is fixed in updates "EBF 22637: 12.0.1 SP70 Build 4085" and "EBF 22519: 16.0 SP9 Build 1823".&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2014 07:48:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829791#M4860634</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2014-04-04T07:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829796#M4860639</link>
      <description>&lt;P&gt;FWIW: When someone like Mikel leaves a CR note, you can usually have a look at the according (public) description here (by adapting the fitting CR number):&lt;/P&gt;
&lt;P&gt;&lt;A href="http://search.sybase.com/kbx/changerequests?bug_id=751771"&gt;http://search.sybase.com/kbx/changerequests?bug_id=751771&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It just tells what you have noticed (though for v16, it sounds different?):&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Fixed Version     Build   Resolution Date     Closure Code (If Appropriate)&lt;BR /&gt;
16.0.0         1839         05 Mar 2014         Fixed&lt;BR /&gt;
12.0.1         4081         05 Mar 2014         Fixed  &lt;/P&gt;
&lt;P&gt;Description&lt;BR /&gt;
A user defined function with a SELECT statement containing a common table expression could have been incorrectly inlined. This has been fixed.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 04 Apr 2014 08:40:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829796#M4860639</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2014-04-04T08:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829797#M4860640</link>
      <description>&lt;P&gt;As an interim workaround, you can add a construct to your UDF that prevents it from being inlined. A variable declaration can be used; I've typically added "IF 1=0 THEN END IF;". In principle in the future either of those could be inlined in the future if the server can determine they don't affect the inlining of the function but they should work for now.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2014 14:40:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829797#M4860640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-04T14:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829798#M4860641</link>
      <description>&lt;P&gt;1)
It is unclear how 05 Mar 2014 may be 16.0.0.1839, when 10 Mar 2014 released 16.0.0.1823 ?&lt;/P&gt;
&lt;P&gt;2)
Performs "ISQL-Plan Viewer" on Sybase SA 12.0.1.3924 (and younger) request:&lt;/P&gt;
&lt;P&gt;select dba.FTest1(TEST1.ID1) from dba.TEST1&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The query itself runs fine without errors.
In "Plan Viewer" I see the query plan for "Main Query" and "SubQ1"
(query plan when the dba.FTest1).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Performs "ISQL-Plan Viewer" on Sybase SA 12.0.1.4085 request:&lt;/P&gt;
&lt;P&gt;select dba.FTest1(TEST1.ID1) from dba.TEST1&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The query itself runs fine without errors.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;BUT in the "Plan Viewer" I can only see the query plan for "Main Query" and see no "SubQ1" (query plan when the dba.FTest1).&lt;/P&gt;
&lt;P&gt;Q: How much in 12.0.1.4085 in "Plan Viewer" does not show the query execution plan dba.FTest1 (SubQ1) ?&lt;/P&gt;
&lt;P&gt;P.S. What is interesting, if dba.FTest1 option "DETERMINISTIC" replaced by "NOT DETERMINISTIC" and then in 12.0.1.3924 in "Plan Viewer" does not show the query execution plan dba.FTest1 (SubQ1).
The impression is that the correction of this error in 12.0.1.4085 for similar UDF simply substitute option "NOT DETERMINISTIC" real and inline-optimization occurs.&lt;/P&gt;
&lt;P&gt;Correct me if I'm wrong ...&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 10:50:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829798#M4860641</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2014-04-07T10:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829799#M4860642</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;1) It is unclear how 05 Mar 2014 may be 16.0.0.1839, when 10 Mar 2014 released 16.0.0.1823&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The one is the "fixing date", the other a release date - so it should not come as a surprise that an error is fixed some time before it is released, and that in the meantime a further EBF is released...&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 11:10:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829799#M4860642</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2014-04-07T11:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829800#M4860643</link>
      <description>&lt;P&gt;Please post the *.saplan file for the plan that you are talking about... to repeat, please ensure the file you post is the one you are talking about (no offense intended, but there's been a lot of posted code in this forum lately that is fundamentally different from the associated discussions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 11:33:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829800#M4860643</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2014-04-07T11:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829801#M4860644</link>
      <description>&lt;P&gt;...plus, history shows that 16.0.0.1839 is unlikely ever to be released; what WILL be released is some subsequent build that passes QA, and it will include everything fixed as of build 1839.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 11:36:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829801#M4860644</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2014-04-07T11:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829792#M4860635</link>
      <description>&lt;P&gt;&lt;STRONG&gt;2Breck Carter:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;SQL-code tables, UDF, the request is in zip-files (with the execution plan of 
the query).&lt;/P&gt;
&lt;P&gt;File &lt;A href="https://sqlanywhere-forum.sap.com/upfiles/plan_sa_12.0.1.3924.zip"&gt;plan_sa_12.0.1.3924.zip&lt;/A&gt; - is a query execution plan in SA 12.0.1.3924, 
in it as you see there is an execution plan for "Main Query" and "SubQ1" 
(an execution plan for dba.FTest1).&lt;/P&gt;
&lt;P&gt;File &lt;A href="https://sqlanywhere-forum.sap.com/upfiles/plan_sa_12.0.1.4085.zip"&gt;plan_sa_12.0.1.4085.zip&lt;/A&gt; - is a query execution plan in SA 12.0.1.4085, 
in it as you see there is only the execution plan for "Main Query", but there 
is no implementation plan for dba.FTest1 ("SubQ1").&lt;/P&gt;
&lt;P&gt;For comparison, add another file &lt;A href="https://sqlanywhere-forum.sap.com/upfiles/plan_sa_12.0.1.3924.NOT_DETERMINISTIC.zip"&gt;plan_sa_12.0.1.3924.NOT_DETERMINISTIC.zip&lt;/A&gt; - 
this query execution plan in SA 12.0.1.3924 on condition that dba.FTest1 
enabled option "NOT DETERMINISTIC".
In it you see there is only the execution plan for "Main Query", but there 
is no implementation plan for dba.FTest1 ("SubQ1").&lt;/P&gt;
&lt;P&gt;If we compare the running of the query plans 
plan_sa_12.0.1.3924.NOT_DETERMINISTIC.zip and plan_sa_12.0.1.4085.zip 
we see that they are almost identical.
The impression is that the correction of this error in 12.0.1.4085 for 
similar UDF simply substitute option "NOT DETERMINISTIC" real and 
inline-optimization occurs.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2014 10:53:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829792#M4860635</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2014-04-08T10:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829802#M4860645</link>
      <description>&lt;P&gt;Have you watched the query execution plans ?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2014 06:05:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829802#M4860645</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2014-04-11T06:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829803#M4860646</link>
      <description>&lt;P&gt;&lt;STRONG&gt;2Breck Carter&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Have you watched the query execution plans ?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:44:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829803#M4860646</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2014-04-17T10:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829804#M4860647</link>
      <description>&lt;P&gt;&lt;STRONG&gt;2Breck Carter&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Have you watched the query execution plans for Sybase SA 12.0.1.3924 and Sybase SA 12.0.1.4085 ?&lt;/P&gt;</description>
      <pubDate>Sat, 10 May 2014 09:13:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829804#M4860647</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2014-05-10T09:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829805#M4860648</link>
      <description>&lt;P&gt;No, I haven't looked at the files... &lt;A href="http://sqlanywhere-forum.sap.com/questions/19411/sybase-sa12-16-error-query-optimization-with-udf#21157"&gt;on April 4 you marked this question as "answered"&lt;/A&gt; so it's not clear what you expect.&lt;/P&gt;</description>
      <pubDate>Sat, 10 May 2014 15:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829805#M4860648</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2014-05-10T15:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829806#M4860649</link>
      <description>&lt;P&gt;Furthermore, in case the mentioned EBFs have &lt;EM&gt;not fixed the problem&lt;/EM&gt; from you point of view (in contrast to the statement within your own "accepted answer"), then please explain this clearly.&lt;/P&gt;
&lt;P&gt;If they have fixed the problem but you have noticed a different one, then please ask a new question (and link it to this one, if this makes sense).&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2014 03:55:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829806#M4860649</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2014-05-12T03:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829807#M4860650</link>
      <description>&lt;P&gt;Then look for these files please.&lt;/P&gt;
&lt;P&gt;I have not noticed the issue as noted "answered" or did it wrong.&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2014 04:32:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829807#M4860650</guid>
      <dc:creator>former_SQLA_member1694881</dc:creator>
      <dc:date>2014-05-12T04:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sybase SA12, 16: Error query optimization with UDF</title>
      <link>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829808#M4860651</link>
      <description>&lt;P&gt;Here's the status of your own answer:&lt;/P&gt;
&lt;P&gt; &lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Re Sybase SA12 16 Error query optimization with UDF"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/189622iFD6FB4660887E9D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Re Sybase SA12 16 Error query optimization with UDF" alt="Re Sybase SA12 16 Error query optimization with UDF" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As marked, the answer is "accepted" by you - and that will tell us that your question has been answered (or your problem has been solved) in an appropriate manner.&lt;/P&gt;
&lt;P&gt;If that is not true, then please "unmark" that answer (if that is possible after that timespan, I don't know)...&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;As to the files: Sorry, I don't understand the issue , I'll leave it to others...&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2014 07:08:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sybase-sa12-16-error-query-optimization-with-udf/qaa-p/13829808#M4860651</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2014-05-12T07:08:14Z</dc:date>
    </item>
  </channel>
</rss>

