pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Radhika Vutukuru <rvutukur@saraf.com>
To: pgsql-sql@postgresql.org
Subject: working with stored procedures
Date: Mon, 14 May 2001 14:41:28 -0500
Message-ID: <001c01c0dcad$de53f130$77bdd93f@saraf.com> (raw)

Hi ,
I am trying to create a stored procedure that returns a user defined type. The following piece of code shows the way I am trying to do it.
regy1=> create function regyuser_rec(int) returns varchar as ' declare
regy1'> v_userid alias for $1;
regy1'> output_rec varchar(400);
regy1'> user_rec record;
regy1'> 
regy1'> begin
regy1'> 
regy1'> select fname ,lname into user_rec from regyuser
regy1'>  where userid = v_userid;
regy1'> output_rec := user_rec;
regy1'> return output_rec;
regy1'> end;
regy1'> ' language 'plpgsql';
CREATE
regy1=> select regyuser_rec(2);
ERROR:  Attribute 'user_rec' not found

Does a postgresql function returns a user defined object?
If so, could I have an example.
I am new to postgresql, and was trying to figure out what's wrong with my code.Could some one help me.
Thanks,
Radhika.

Message-ID: <001c01c0dcad$de53f130$77bdd93f@saraf.com>
Permalink:  ../001c01c0dcad$de53f130$77bdd93f@saraf.com/
Also on:    postgresql.org/message-id/001c01c0dcad$de53f130$77bdd93f@saraf.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: rvutukur@saraf.com
  Subject: Re: working with stored procedures
  In-Reply-To: <001c01c0dcad$de53f130$77bdd93f@saraf.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