<div class="gmail_quote">On Tue, Jun 21, 2011 at 7:47 AM, David Virebayre <span dir="ltr">&lt;<a href="mailto:dav.vire%2Bhaskell@gmail.com">dav.vire+haskell@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">The problem isn&#39;t with the stored procedure, it works if I call it</div>
from the mysql client.<br></blockquote><div><br></div><div>Right - as I mentioned in my previous note, the problem is that stored procedures and multi-statement queries can both return multiple result sets. We can&#39;t easily use type inference to express the difference between &quot;in this use of query, I want a single result&quot; (the common case) and &quot;in this other use of query, I expect three results, each with different shapes&quot; (far less common), so we need something like a multiQuery function (and perhaps a MultiResult class) instead.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Another unrelated thing : the documentation states that the Query type<br>
is designed to make it difficult to create queries by concatenating<br>
strings.<br></blockquote><div><br></div><div>You can do it, but you have to use the Monoid class&#39;s functions, e.g.: &quot;select &quot; `mappend` &quot;2 + 2&quot;</div><div><br></div><div>For cases like your &quot;show columns from&quot; example, though, I prefer Chris&#39;s suggestion of creating a custom newtype with its own special Param instance.</div>
</div>