<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <blockquote type="cite">
      <div class="msgHead" style="color: rgb(0, 0, 0); font-family:
        helvetica, arial, sans-serif; font-size: 14px; font-style:
        normal; font-variant-ligatures: normal; font-variant-caps:
        normal; font-weight: 400; letter-spacing: normal; orphans: 2;
        text-align: start; text-indent: 0px; text-transform: none;
        white-space: normal; widows: 2; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
        255); text-decoration-thickness: initial; text-decoration-style:
        initial; text-decoration-color: initial;">
        <p class="darkgray font13" style="font-size: 13px; color:
          rgb(102, 102, 102);"><span class="sender pipe"
            style="margin-right: 0.5em; border-right: 1px solid rgb(221,
            221, 221); padding-right: 0.8em;"><a
href="https://www.mail-archive.com/search?l=qgis-user@lists.osgeo.org&q=from:%22Bernd+Vogelgesang%22"
              rel="nofollow" style="color: rgb(102, 102, 102);
              text-decoration: none;"><span itemprop="author"
                itemscope="" itemtype="http://schema.org/Person"><span
                  itemprop="name">Bernd Vogelgesang</span></span></a></span><span> </span><span
            class="date"><a
href="https://www.mail-archive.com/search?l=qgis-user@lists.osgeo.org&q=date:20220119"
              rel="nofollow" style="color: rgb(102, 102, 102);
              text-decoration: none;">Wed, 19 Jan 2022 03:34:05 -0800</a></span></p>
      </div>
      <div itemprop="articleBody" class="msgBody" style="color: rgb(0,
        0, 0); font-family: helvetica, arial, sans-serif; font-size:
        14px; font-style: normal; font-variant-ligatures: normal;
        font-variant-caps: normal; font-weight: 400; letter-spacing:
        normal; orphans: 2; text-align: start; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 2;
        word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgb(255, 255, 255); text-decoration-thickness:
        initial; text-decoration-style: initial; text-decoration-color:
        initial;">
        <pre style="font-family: courier, "courier new", monospace; font-size: 1em; white-space: pre-wrap; overflow-wrap: break-word; margin: 0em;">A while ago, I figured out how to limit a query on a layer by the
current map extent as a preparation for another query:</pre>
        <pre style="font-family: courier, "courier new", monospace; font-size: 1em; white-space: pre-wrap; overflow-wrap: break-word; margin: 0px;">SELECT * FROM ASK_Geometrien WHERE
st_intersects(ASK_Geometrien.geometry, currentExtent());

Now, when I try it again later, the test fails with "no such function:
currentExtent"
</pre>
      </div>
    </blockquote>
    <br>
    Hi Bernd,<br>
    AFAIK there is no currentExtent() inbuilt function.<br>
    <br>
    You need to define a custom currentExtent() function that returns
    the current extent.<br>
    <br>
    Please see, for example:
<a class="moz-txt-link-freetext" href="https://gis.stackexchange.com/questions/303325/how-to-speed-up-a-query-in-a-virtual-layer-of-qgis">https://gis.stackexchange.com/questions/303325/how-to-speed-up-a-query-in-a-virtual-layer-of-qgis</a><br>
    <br>
    Best regards.<br>
    <br>
    Andrea Giudiceandrea<br>
  </body>
</html>