Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group