Return type for procedure

From: "ben sewell" <mosherben(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Return type for procedure
Date: 2006-08-15 08:52:23
Message-ID: bf6c74d80608150152v2ddf70dbw9bf4423a3fbe7622@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,
I'm writing a procedure, where I'm trying to save writing other procedures
by combining all of them in one procedure. All procdures take the same input
parameters so I would imagine this is possible.

What I was wondering was if it was possible for me to return different user
defined types. To try to illustrate what I mean, here's some example code
which I think is allowed:

if id="1" then
processing code
return usertype3;
elseif id="2" then
processing code
return usertype3;
elseif id="3" then
processing code
return usertype3;
endif;

Is this possible?

Cheers,
Ben

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Roger Rasmussen 2006-08-15 10:40:17 Optimal Postgres Development Process, Software
Previous Message Sean Davis 2006-08-14 14:43:13 Re: can someone tell me what's wrong with this procedure?