passing values to a function

From: Cedar Cox <cedarc(at)visionforisrael(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: passing values to a function
Date: 2001-02-18 15:03:23
Message-ID: Pine.LNX.4.21.0102181655080.22616-100000@nanu.visionforisrael.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces


Why does this not work? Am I doing something wrong?

CREATE FUNCTION uutest(text) RETURNS bool AS '
declare
varop alias for $1;
begin
raise notice '' varop is '',varop;
return false;
end;
' LANGUAGE 'plpgsql';

Giving
select uutest('INSERT');
returns

NOTICE: varop is
uutest
--------
f
(1 row)

Has my PG server entered some weird state or something?

One other question.. Is there an easy way to pass an entire record to a
function (eg, the 'new' record)? Presently I am passing all 12 fields as
separate parameters.

-Cedar

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jose Osman Sansuste T. 2001-02-18 22:40:00 Creating an odbc connection... needing help
Previous Message Alexaki Sofia 2001-02-18 12:52:50 speed up creation of a table