<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Vladimir,<div><br></div><div>I think what you may be looking for could involve using a WITH clause in your SQL query:</div><div><a href="http://www.postgresql.org/docs/9.2/static/queries-with.html">www.postgresql.org/docs/9.2/static/queries-with.html</a></div><div>It's useful if you're trying to query a query.</div><div>For viewing it, I'd use a dynamic list (dynamic="true") in Bond:</div><div><div>&lt;list dynamic="true" sortable="true" name="myquery-outputs"&gt;</div><div>&nbsp; &lt;dbobject name="myquery-outputs"&gt;</div><div>&nbsp; &nbsp; &lt;sql&gt;</div><div>&nbsp; &nbsp; &nbsp; WITH (…)</div><div>&nbsp; &nbsp; &nbsp; SELECT (…) FROM (…)</div><div>&nbsp; &nbsp; &lt;/sql&gt;</div><div>&nbsp; &lt;/dbobject&gt;</div><div>&nbsp; &lt;column title="?"&gt;</div><div>&nbsp; &nbsp; &lt;field/&gt;</div><div>&nbsp; &lt;/column&gt;</div><div>&lt;/list&gt;</div></div><div>I personally might shy away from using VALUES lists- fine for having static values, but bad if you would ever want to change it.</div><div>Another option-- if you're interested in still using VALUES, or executing a dynamic query, I might recommend writing a function in pl/pgsql that EXECUTEs a string as a query.</div><div><br></div><div>Does that help?</div><div><br></div><div>-Ezra</div><div><br></div><div><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-style: normal; font-weight: normal; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: 13px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font face="Arial"><div style="color: rgb(0, 0, 0); "><font class="Apple-style-span" color="#6c6c6c"><b>Ezra R. Tucker</b></font></div><div style="color: rgb(0, 0, 0); "><font class="Apple-style-span" color="#6c6c6c">Senior Analyst |<span class="Apple-converted-space">&nbsp;</span></font><b><font class="Apple-style-span" color="#1f497d">Altenex LLC</font></b></div><div style="color: rgb(0, 0, 0); "><font class="Apple-style-span" color="#6c6c6c">7 Liberty Square | Boston, MA 02109</font></div><div><font class="Apple-style-span" color="#6c6c6c">t: 617.500.0105 | m: 818.203.0269</font></div><div style="color: rgb(0, 0, 0); "><font class="Apple-style-span" color="#6c6c6c"><a href="mailto:ezra.tucker@altenex.com">ezra.tucker@altenex.com</a></font></div><div style="color: rgb(0, 0, 0); "><font class="Apple-style-span" color="#6c6c6c"><a href="http://www.altenex.com">www.altenex.com</a></font></div></font></div></span></div></span></div></span></div></div></div></div>
</div>
<br><div><div>On Jul 1, 2013, at 1:24 PM, Vladimir Voznesensky &lt;<a href="mailto:voznesensky@rts.ru">voznesensky@rts.ru</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello.<br><br>Does Bond have a possibility to select several items from a result of <br>some query?<br>It could be used in VALUES lists ( <br><a href="http://www.postgresql.org/docs/9.2/static/queries-values.html">http://www.postgresql.org/docs/9.2/static/queries-values.html</a> ).<br><br>Thank you.<br><br>- VV<br><br>_______________________________________________<br>Bond-users mailing list<br><a href="mailto:Bond-users@lists.hcoop.net">Bond-users@lists.hcoop.net</a><br>https://lists.hcoop.net/listinfo/bond-users<br></blockquote></div><br></div></body></html>