Re: plpgsql function question

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Karthikeyan Sundaram <skarthi98(at)hotmail(dot)com>
Cc: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: plpgsql function question
Date: 2007-04-03 20:27:16
Message-ID: F2B39579-43CE-4074-8AD1-74760FCA5514@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Karthikeyan Sundaram 2007-04-03 22:35:17 exception handling in postgres plpgsql
Previous Message Andrew Sullivan 2007-04-03 20:14:20 Re: A long-running transaction