<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#333333">
    <p>Thanks Howard for the answer,</p>
    <p>Yes, for now i store it temporarly as a view that I then use in
      the post SQL, but I was thinking maybe it is possible to do it
      directly the PDAL way :).<br>
    </p>
    Florent<br>
    <blockquote cite="mid:B905F184-CF7F-4169-8803-AE8F9E4939DF@hobu.co"
      type="cite">
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">On May 18, 2017, at 9:42 AM, Florent Poux <a class="moz-txt-link-rfc2396E" href="mailto:fpoux@ulg.ac.be"><fpoux@ulg.ac.be></a> wrote:

Hey all,

I am struggling with a sql query within pg.pointcloud writer that you may have a solution for.

is there a way to store the pre sql query as a variable that will be used for the post sql query ?

specifically, i want to store as pre sql the count or max from a table, and pass this parameter to condition a query in the post sql, is that possible ?

Thank you !
</pre>
      </blockquote>
      <pre wrap="">
Florent,

There's no *PDAL* way to do this, but could you stash your variable in some kind of temporary (are there bound-to-session variables?, maybe another table) for use by the post sql?

This reminds me I've wanted to make the PointView metadata available to DB writers' post_sql methods as a variable. Very similar to what we did for the writers.las <a class="moz-txt-link-freetext" href="https://www.pdal.io/tutorial/las.html#metadata-example">https://www.pdal.io/tutorial/las.html#metadata-example</a> I could see how this might be useful to downstream consumers.

Howard

</pre>
    </blockquote>
    <br>
  </body>
</html>