Re: [SQL] assign the row count of a query to a variable

2005-01-14 Thread Michael Fuhr
On Fri, Jan 14, 2005 at 03:43:04PM -0500, Kevin B. wrote: > I'm trying to assign the row count of a query to a variable in a function > but I'm not having any luck. Please be more specific than "not having any luck." What are you expecting to happen and what actually does happen? > Could someon

Re: [SQL] assign the row count of a query to a variable

2005-01-14 Thread PFC
var := count(*) from T; or : SELECT INTO var count(*) from T; ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can

[SQL] assign the row count of a query to a variable

2005-01-14 Thread Kevin B.
Hi, I'm trying to assign the row count of a query to a variable in a function but I'm not having any luck. Could someone tell me the syntax? I've been looking in the docs and googling for a long time but just can't find the answer. I've tried: CREATE OR REPLACE FUNCTION ret1() RETURNS int4 AS '