<div class="gmail_quote">On Tue, Jun 21, 2011 at 7:47 AM, David Virebayre <span dir="ltr"><<a href="mailto:dav.vire%2Bhaskell@gmail.com">dav.vire+haskell@gmail.com</a>></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'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't easily use type inference to express the difference between "in this use of query, I want a single result" (the common case) and "in this other use of query, I expect three results, each with different shapes" (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's functions, e.g.: "select " `mappend` "2 + 2"</div><div><br></div><div>For cases like your "show columns from" example, though, I prefer Chris's suggestion of creating a custom newtype with its own special Param instance.</div>
</div>