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

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Dino Vliet <dino_vliet(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: can function arguments have the type tablename.columnname%TYPE?
Date: 2010-05-12 04:54:36
Message-ID: AANLkTilLMdFsp5KlX66RGjM5K4u9hC6QVqF_qgWXzjqS@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

What is the main goal? Aren't you looking for a solution to simplify
arguments declaration?

If so then what about using this one:

CREATE OR REPLACE FUNCTION totnrchange(t table1)
RETURNS integer AS
$BODY$
DECLARE
tot integer;
BEGIN
select count(resnr) into tot from table1
where resnr = t.resnr and fnr = t.fnr ...
...

--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray(dot)ru(at)gmail(dot)com / Skype: gray-hemp / ICQ: 29353802

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2010-05-12 04:58:00 Re: Pulling data from a constraint def
Previous Message Reid Thompson 2010-05-12 02:38:32 Re: list of databases in C ? libpq ?