pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajesh Kumar Mallah. <mallah@trade-india.com>
To: Tomasz Myrta <jasiek@klaster.net>
To: Atul <atul@imcindia.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Stored Procedure Problem
Date: Fri, 13 Dec 2002 16:31:42 +0530
Message-ID: <200212131631.42051.mallah@trade-india.com> (raw)
In-Reply-To: <3DF8A280.1010107@klaster.net>
References: <LHEOILFLDANINFJAGPEOIEFNCAAA.atul@imcindia.net>
	<3DF8A280.1010107@klaster.net>


In 7.3 you can ,

in follwoing steps,

1. do a CREATE TYPE (i would recommend to use a sperate schema for storing user defined types)
2. in plpgsql declare the RECORD of that type .

3. populate the record varible according to your business logic and return the RECORD using  RETURN statements.


hope it will help ,
if not please revert back.


regds
mallah.

On Thursday 12 December 2002 08:21 pm, Tomasz Myrta wrote:
> Atul wrote:
> > CREATE FUNCTION b_function() RETURNS varchar AS '
> >
> >  DECLARE
> >
> >     an_integer int4;
> >
> >     an_name    varchar;
> >
> >  BEGIN
> >
> >     select into an_integer emp_id,an_name emp_name from employee;
> >
> >     return an_integer,an_name;
> >
> >  END;
> >
> >  '
>
> First: select into an_integer,an_name emp_id,emp_name...
> Second: you can't return 2 variables from plpgsql function.
>
> Tomasz Myrta
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.





view thread (7+ messages)

Message-ID: <200212131631.42051.mallah@trade-india.com>
Permalink:  ../200212131631.42051.mallah@trade-india.com/
Also on:    postgresql.org/message-id/200212131631.42051.mallah@trade-india.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: mallah@trade-india.com, jasiek@klaster.net, atul@imcindia.net
  Subject: Re: Stored Procedure Problem
  In-Reply-To: <200212131631.42051.mallah@trade-india.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