Re: assign count() result to a declared variable in plpgsql - Mailing list pgsql-sql

From Jeff Eckermann
Subject Re: assign count() result to a declared variable in plpgsql
Date
Msg-id 20020624180618.97711.qmail@web20805.mail.yahoo.com
Whole thread Raw
In response to assign count() result to a declared variable in plpgsql  (Joseph Syjuco <joseph@asti.dost.gov.ph>)
List pgsql-sql
try:
f_count_var := count(empno) from employee;

--- Joseph Syjuco <joseph@asti.dost.gov.ph> wrote:
> 
> i want to put my count() result in a plpgsql
> declared integer variable
> 
> 
> declare f_count_var integer;
> begin
>     select into f_count_var count(empno) from employee
> end;
> 
> tried this one but it doesnt work
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to majordomo@postgresql.org
> so that your
> message can get through to the mailing list cleanly
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com




pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: variance aggregate function incorrect? Reference Materials
Next
From: Stephan Szabo
Date:
Subject: Re: Slow SELECT with distinct, in a TIMESTAMP type column