Thanks a lot, that worked great. Saved me a lot of time trying to
figure it out too.
Christine
It works for me:
postgres=# CREATE OR REPLACE FUNCTION countertest(integer) RETURNS
bigint AS $$ SELECT COUNT(*) FROM test WHERE nbr = $1; $$ LANGUAGE
SQL;
CREATE FUNCTION
postgres=# select countert
On Wed, Dec 23, 2009 at 9:03 AM, Christine Penner
wrote:
> Hi,
>
> I'm trying to create a simple function but having a bit of trouble. This is
> what I want to do.
>
> I want to pass a key as a parameter (BKEY integer)
> the code in the function should be
> count(*) from F_BUILDINGS where B_PRIMAR
- "Christine Penner" wrote:
> Hi,
>
> I'm trying to create a simple function but having a bit of trouble.
> This is what I want to do.
>
> I want to pass a key as a parameter (BKEY integer)
> the code in the function should be
> count(*) from F_BUILDINGS where B_PRIMARY_SEQ=BKEY
>
> I
Hi,
I'm trying to create a simple function but having a bit of trouble.
This is what I want to do.
I want to pass a key as a parameter (BKEY integer)
the code in the function should be
count(*) from F_BUILDINGS where B_PRIMARY_SEQ=BKEY
I want to return the count from the select statement.
Ch
On Tue, Dec 07, 2004 at 14:49:14 -0300,
MaRCeLO PeReiRA <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I have a table with two integer fields (field1 and
> field2)...
>
> I would like to construct a function that perform an
> operation with this two fiels (field1 + fields2), and
> return the string
Hi guys,
I have a table with two integer fields (field1 and
field2)...
I would like to construct a function that perform an
operation with this two fiels (field1 + fields2), and
return the string value "A" if the sum is <20, "B" if
the sum is >=20 or <=50, and finally return "C" if the
sum is >50