Search Postgresql Archives

Re: Get count of records from SELECT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 15, 2005 at 05:56:27PM +0300, Zet wrote:
> Hi
> 
> I have example:

<snip>

> -- here I will get count of records in "rnum", but I need in LOOP's
> -- first step

You can't, because by that stage the query hasn't finished running yet.
What you need to do is put the output for the query in a temporary
table. Then GET DIAGNOSTICS will have the rowcount. Then you can loop
over that table.

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgp0xq5EemMRf.pgp
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux