pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John DeSoi <desoi@pgedit.com>
To: Karthikeyan Sundaram <skarthi98@hotmail.com>
Cc: Andreas Kretschmer <akretschmer@spamfence.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: plpgsql function question
Date: Tue, 3 Apr 2007 16:27:16 -0400
Message-ID: <F2B39579-43CE-4074-8AD1-74760FCA5514@pgedit.com> (raw)
In-Reply-To: <BAY131-W18D3A18906E05E2B1E90CCB0670@phx.gbl>
References: <BAY131-W18D3A18906E05E2B1E90CCB0670@phx.gbl>

It should work pretty much like you have it. You don't need a type;  
the table is already a type.

Something like:

create or replace function a_func (in p_row a) returns int as
$$
   if p_row.i ...
   if p_row.j ...
$$

If it does not work, show the error and I'll try to dig up an example.

John



On Apr 3, 2007, at 2:33 PM, Karthikeyan Sundaram wrote:

> What I want is something like this
> create or replace functinon a_func (in a%rowtype) returns int as
> $$
>    ---- do the validation
> $$
> language 'plpgsql';
>
> execute a_func(1, 'good','04/02/2007');



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL




view thread (7+ messages)  latest in thread

Message-ID: <F2B39579-43CE-4074-8AD1-74760FCA5514@pgedit.com>
Permalink:  ../F2B39579-43CE-4074-8AD1-74760FCA5514@pgedit.com/
Also on:    postgresql.org/message-id/F2B39579-43CE-4074-8AD1-74760FCA5514@pgedit.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: desoi@pgedit.com, skarthi98@hotmail.com, akretschmer@spamfence.net
  Subject: Re: plpgsql function question
  In-Reply-To: <F2B39579-43CE-4074-8AD1-74760FCA5514@pgedit.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox