<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Base Direct SQL Not Running Properly"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=144694">144694</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Base Direct SQL Not Running Properly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.2.1.1 rc
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Base
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>flywire0@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Direct SQL should process code the same as running it directly for both Tools →
SQL and Query → Direct SQL.

The only real difference between these commands should be the second one holds
the output in a view (query grid).

(In reply to Robert Großkopf from
<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Tools > SQL : add a checkbox to enable Direct SQL"
   href="show_bug.cgi?id=143656#c18">https://bugs.documentfoundation.org/show_bug.cgi?id=143656#c18</a>)
<span class="quote">> (In reply to flywire from <a href="show_bug.cgi?id=144694#c17">comment #17</a>)</span >

Your findings are consistent with mine:

<span class="quote">> Empty SQLite database:
> 1. Output is never generated by Tools → SQL
> 2. Run code through Query → Direct SQL and table is generated first time [but returns error "The data content could not be loaded. The execution of the query doesn't return a valid result set."], run WITH RECURSIVE... code again and output is generated.</span >

=====

*query.sql*

CREATE TABLE org(
  name TEXT PRIMARY KEY,
  boss TEXT REFERENCES org
) WITHOUT ROWID;
INSERT INTO org VALUES('Alice',NULL);
INSERT INTO org VALUES('Bob','Alice');
INSERT INTO org VALUES('Cindy','Alice');
INSERT INTO org VALUES('Dave','Bob');
INSERT INTO org VALUES('Emma','Bob');
INSERT INTO org VALUES('Fred','Cindy');
INSERT INTO org VALUES('Gail','Cindy');

WITH RECURSIVE
  under_alice(name,level) AS (
    VALUES('Alice',0)
    UNION ALL
    SELECT org.name, under_alice.level+1
      FROM org JOIN under_alice ON org.boss=under_alice.name
     ORDER BY 2 DESC
  )
SELECT substr('..........',1,level*3) || name FROM under_alice;

*output*

Alice
...Bob
......Dave
......Emma
...Cindy
......Fred
......Gail


Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: e9b674a768fcf534335f172664aaf13dc2c79023
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: en-AU (en_AU); UI: en-GB
Calc: threaded</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>