can function arguments have the type tablename.columnname%TYPE? - Mailing list pgsql-general

From Dino Vliet
Subject can function arguments have the type tablename.columnname%TYPE?
Date
Msg-id 196425.73107.qm@web51102.mail.re2.yahoo.com
Whole thread Raw
Responses Re: can function arguments have the type tablename.columnname%TYPE?
Re: can function arguments have the type tablename.columnname%TYPE?
List 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

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: log database in which error occurs
Next
From: Jason Armstrong
Date:
Subject: Workqueue performance