can function arguments have the type tablename.columnname%TYPE?

From: Dino Vliet <dino_vliet(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: can function arguments have the type tablename.columnname%TYPE?
Date: 2010-05-11 08:28:10
Message-ID: 196425.73107.qm@web51102.mail.re2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi people,
I'm writing a plpgsql function in pgadminIII and want to know if the arguments can have the following type:

tablename.columnname%TYPE

If so, how do I accomplish this in pgadminIII as it doesn't allow me to change the arguments to this type.

The function I'm writing looks like this:

CREATE OR REPLACE FUNCTION totnrchange(a table1.resnr%TYPE, b table1.fnr%TYPE, c table1.fdate%TYPE, d table1.dep%TYPE, e table1.arr%TYPE, f table1.nrdays%TYPE)
RETURNS integer AS
$BODY$DECLARE
tot integer;
BEGIN
select count(resnr) into tot from table1 x where x.resnr=a and x.fnr=b and x.fdate=c and x.dep=d and x.arr=e and x.nrdays>=f group by x.resnr,x.fnr,x.fdate,x.dep,x.arr;
return tot;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
 
 
 

Brgds
Dino

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason Armstrong 2010-05-11 08:28:33 Workqueue performance
Previous Message A. Kretschmer 2010-05-11 08:27:06 Re: log database in which error occurs