<?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: Turning a recursive query into a view raises SQLCODE -812 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837949#M4868792</link>
    <description>&lt;P&gt;After much confusion, I've found out that the problem is due to the fact that views don't allow "SELECT *" in the underlying query unless in the top level query block, and in the sample the "SELECT *" apparently appears inside subqueries... - so that is a violation of the documented &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/create-view-statement.html"&gt;CREATE VIEW&lt;/A&gt; restrictions:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;SELECT * can only be used in the main query of the CREATE VIEW statement.&lt;/STRONG&gt; Derived tables and subqueries must use full expressions in the SELECT list, rather than the * operator. For example, CREATE VIEW V AS SELECT * FROM T, (SELECT * FROM R) AS DT is incorrect, as the derived table DT is specified using SELECT * rather than using a SELECT list with specified expressions. Similarly, an implicit SELECT * used in a derived table is not allowed. For example, CREATE VIEW V AS SELECT * FROM T, LATERAL(proc(T.A.)) AS DT has an implicit SELECT *, as LATERAL(proc(T.A.)) is a short form for LATERAL(SELECT * FROM proc(T.A.)) and is therefore not allowed in the view definition. &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, replacing the "SELECT e.*" with an explicit column list in the recursive query's two UNIONed query blocks does solve the problem and makes the view createable.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;However, IMHO the error message does seem misleading here, and the documented probable cause, too:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Probable cause&lt;/STRONG&gt;&lt;BR /&gt;
The specified alias from the derived table's AS clause has no matching expression from the SELECT statement for that derived table. Ensure that each SELECT list item has a matching alias in the derived table's AS clause, and vice-versa. &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That made me leave another personal learning experience here:)&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2012 16:33:07 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2012-10-03T16:33:07Z</dc:date>
    <item>
      <title>Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaq-p/13837948</link>
      <description>&lt;P&gt;This is a variation of the sample query used in this recent &lt;A href="http://sqlanywhere-forum.sap.com/questions/13621" target="_blank"&gt;FAQ on recursive queries&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;In contrast to the sample query from the question (not from the answer), it includes all columns from the underlying table, so it uses "SELECT *" for simplicity in the recursive queries:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="k"&gt;WITH&lt;/SPAN&gt; &lt;SPAN class="k"&gt;RECURSIVE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee_hierarchie&lt;/SPAN&gt;
   &lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="k"&gt;level&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="n"&gt;manager_id&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="n"&gt;name&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="n"&gt;salary&lt;/SPAN&gt; &lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="k"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="k"&gt;CAST&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt; &lt;SPAN class="k"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="nb"&gt;INTEGER&lt;/SPAN&gt; &lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="k"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="k"&gt;level&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="o"&gt;*&lt;/SPAN&gt;
       &lt;SPAN class="k"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt; &lt;SPAN class="k"&gt;where&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;manager_id&lt;/SPAN&gt;
     &lt;SPAN class="k"&gt;UNION&lt;/SPAN&gt; &lt;SPAN class="k"&gt;ALL&lt;/SPAN&gt;
     &lt;SPAN class="k"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;h&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="k"&gt;level&lt;/SPAN&gt; &lt;SPAN class="o"&gt;+&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="o"&gt;*&lt;/SPAN&gt;
       &lt;SPAN class="k"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee_hierarchie&lt;/SPAN&gt; &lt;SPAN class="n"&gt;h&lt;/SPAN&gt;
            &lt;SPAN class="k"&gt;INNER&lt;/SPAN&gt; &lt;SPAN class="k"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;
                    &lt;SPAN class="k"&gt;ON&lt;/SPAN&gt; &lt;SPAN class="n"&gt;h&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;manager_id&lt;/SPAN&gt;
      &lt;SPAN class="k"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt; &lt;SPAN class="o"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;manager_id&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="o"&gt;*&lt;/SPAN&gt;
  &lt;SPAN class="k"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee_hierarchie&lt;/SPAN&gt;
  &lt;SPAN class="k"&gt;ORDER&lt;/SPAN&gt; &lt;SPAN class="k"&gt;BY&lt;/SPAN&gt; &lt;SPAN class="k"&gt;level&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;Whereas this works fine as a query, turning that into a view by simply adding a CREATE VIEW &lt;EM&gt;viewname&lt;/EM&gt; AS statement like&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="k"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="k"&gt;VIEW&lt;/SPAN&gt; &lt;SPAN class="n"&gt;V_employee_hierarchie&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;AS&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;WITH&lt;/SPAN&gt; &lt;SPAN class="k"&gt;RECURSIVE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee_hierarchie&lt;/SPAN&gt;
   &lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="k"&gt;level&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="n"&gt;manager_id&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="n"&gt;name&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="n"&gt;salary&lt;/SPAN&gt; &lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="k"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="k"&gt;CAST&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt; &lt;SPAN class="k"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="nb"&gt;INTEGER&lt;/SPAN&gt; &lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="k"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="k"&gt;level&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="o"&gt;*&lt;/SPAN&gt;
       &lt;SPAN class="k"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt; &lt;SPAN class="k"&gt;where&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;manager_id&lt;/SPAN&gt;
     &lt;SPAN class="k"&gt;UNION&lt;/SPAN&gt; &lt;SPAN class="k"&gt;ALL&lt;/SPAN&gt;
     &lt;SPAN class="k"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;h&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="k"&gt;level&lt;/SPAN&gt; &lt;SPAN class="o"&gt;+&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="o"&gt;*&lt;/SPAN&gt;
       &lt;SPAN class="k"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee_hierarchie&lt;/SPAN&gt; &lt;SPAN class="n"&gt;h&lt;/SPAN&gt;
            &lt;SPAN class="k"&gt;INNER&lt;/SPAN&gt; &lt;SPAN class="k"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;
                    &lt;SPAN class="k"&gt;ON&lt;/SPAN&gt; &lt;SPAN class="n"&gt;h&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;manager_id&lt;/SPAN&gt;
      &lt;SPAN class="k"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt; &lt;SPAN class="o"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;manager_id&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="o"&gt;*&lt;/SPAN&gt;
  &lt;SPAN class="k"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee_hierarchie&lt;/SPAN&gt;
    &lt;SPAN class="c1"&gt;-- ORDER BY should be avoided, as there's not SELECT TOP/FIRST&lt;/SPAN&gt;
  &lt;SPAN class="k"&gt;ORDER&lt;/SPAN&gt; &lt;SPAN class="k"&gt;BY&lt;/SPAN&gt; &lt;SPAN class="k"&gt;level&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;employee_id&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;does not work, but raises the surprising error SQLCODE -812 with message:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;The SELECT list for the derived table 'employee_hierarchie' has no expression to match 'manager_id'&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This message really doesn't seem to make sense to me, particulary as the select list obviously &lt;EM&gt;does&lt;/EM&gt; fit, otherwise the recursive query wouldn't work.&lt;/P&gt;
&lt;P&gt;So what's the matter here? - I've tested with the newest EBF 12.0.1.3769, too.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 16:20:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaq-p/13837948</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-10-03T16:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837949#M4868792</link>
      <description>&lt;P&gt;After much confusion, I've found out that the problem is due to the fact that views don't allow "SELECT *" in the underlying query unless in the top level query block, and in the sample the "SELECT *" apparently appears inside subqueries... - so that is a violation of the documented &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/create-view-statement.html"&gt;CREATE VIEW&lt;/A&gt; restrictions:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;SELECT * can only be used in the main query of the CREATE VIEW statement.&lt;/STRONG&gt; Derived tables and subqueries must use full expressions in the SELECT list, rather than the * operator. For example, CREATE VIEW V AS SELECT * FROM T, (SELECT * FROM R) AS DT is incorrect, as the derived table DT is specified using SELECT * rather than using a SELECT list with specified expressions. Similarly, an implicit SELECT * used in a derived table is not allowed. For example, CREATE VIEW V AS SELECT * FROM T, LATERAL(proc(T.A.)) AS DT has an implicit SELECT *, as LATERAL(proc(T.A.)) is a short form for LATERAL(SELECT * FROM proc(T.A.)) and is therefore not allowed in the view definition. &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, replacing the "SELECT e.*" with an explicit column list in the recursive query's two UNIONed query blocks does solve the problem and makes the view createable.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;However, IMHO the error message does seem misleading here, and the documented probable cause, too:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Probable cause&lt;/STRONG&gt;&lt;BR /&gt;
The specified alias from the derived table's AS clause has no matching expression from the SELECT statement for that derived table. Ensure that each SELECT list item has a matching alias in the derived table's AS clause, and vice-versa. &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That made me leave another personal learning experience here:)&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 16:33:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837949#M4868792</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-10-03T16:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837951#M4868794</link>
      <description>&lt;P&gt;I just added a comment that it worked fine for me with just a SELECT * FROM V_employee_hierarchie while you were adding your response !&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 16:38:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837951#M4868794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-03T16:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837952#M4868795</link>
      <description>&lt;P&gt;So you're saying the view as stated in the query &lt;EM&gt;does&lt;/EM&gt; work for you? What version are you using? (I've tested with 12.0.1.3726 on Windows.)&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 16:54:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837952#M4868795</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-10-03T16:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837950#M4868793</link>
      <description>&lt;P&gt;The final &lt;/P&gt;
&lt;PRE&gt;SELECT *
  FROM employee_hierarchie
  ORDER BY level, employee_id
&lt;/PRE&gt;

&lt;P&gt;should not be part of the CREATE VIEW... it is the actual query that USES the view &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 17:13:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837950#M4868793</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-10-03T17:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837953#M4868796</link>
      <description>&lt;P&gt;Show us the whole CREATE VIEW please.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 17:14:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837953#M4868796</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-10-03T17:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837954#M4868797</link>
      <description>&lt;P&gt;I have to contradict: The "ORDER BY clause" should be avoided (as there is no SELECT TOP/FIRST), however, without a top level select a view cannot be created, and without that SELECT, there's only a recursive common table expression, nothing else.&lt;/P&gt;
&lt;P&gt;Trying to omit the SELECT ... leads to a -131 error ("Syntax error near (end of line)").&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 17:19:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837954#M4868797</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-10-03T17:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837955#M4868798</link>
      <description>&lt;P&gt;I am using 12.0.1.3769 on Windows as well.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 17:51:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837955#M4868798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-03T17:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837956#M4868799</link>
      <description>&lt;P&gt;Here you are:)&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 17:53:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837956#M4868799</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-10-03T17:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837957#M4868800</link>
      <description>&lt;P&gt;I've just tested with 12.0.1.3769, and I still get the error message (and if I'm reading the docs correctly, the view &lt;EM&gt;should&lt;/EM&gt; fail with an error - however probably a better message...).&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2012 18:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837957#M4868800</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-10-03T18:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Turning a recursive query into a view raises SQLCODE -812</title>
      <link>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837958#M4868801</link>
      <description>&lt;P&gt;My mistake... it is also contradicted by this statement "The previous query can be turned into a permanent view by replacing the outer SELECT with a simple "SELECT *" and giving it a name in a CREATE VIEW statement..." in &lt;A href="http://sqlanywhere.blogspot.com/2012/04/example-recursive-union.html"&gt;http://sqlanywhere.blogspot.com/2012/04/example-recursive-union.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 17:05:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/turning-a-recursive-query-into-a-view-raises-sqlcode-812/qaa-p/13837958#M4868801</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-10-04T17:05:22Z</dc:date>
    </item>
  </channel>
</rss>

