[Mono-list] Npgsql.dll
Chris Aitken
chris at ion-dreams.com
Mon Jun 20 04:13:15 EDT 2005
> Here's my parameterized function:
>
> CREATE OR REPLACE FUNCTION getsenators(text)
> RETURNS SETOF senators AS
> '
> DECLARE
> input ALIAS FOR $1;
> r senators%rowtype;
> BEGIN
> FOR r IN SELECT s_fname,s_lname,s_email
> FROM senate_members WHERE s_party=input LOOP
> RETURN NEXT r;
> END LOOP;
> RETURN;
> END
> '
> LANGUAGE 'plpgsql' VOLATILE;
>
> When I type SELECT * FROM getsenators('D') I get the correct
> set of records.
>
> I'm not even sure why it wasn't working before or what I did
> to fix it, but I now have working examples I can copy and use
> as templates.
Your previous select (that didn't work) had " instead if '. Unsure if that
was a typo - but the error message looks to confirm the fact that double
quotes were used.
Chris
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Mono-list
mailing list