FW: need help on stored procedures

From: "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar(dot)Pyatalo(at)honeywell(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: FW: need help on stored procedures
Date: 2004-07-08 05:28:46
Message-ID: 77ED2BF75D59D1439F90412CC5B109740E95D35E@ie10-sahara.hiso.honeywell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


> Hi all,
>
> I have written a sample procedure where i pass 2 arguments. Based on the
> arguments i need to select few fields from a table. After selecting the
> fields i have to display them. How do i return the selected fields. The
> procedure is as follows
>
> CREATE FUNCTION PP_ReadParameter(integer,varchar) RETURNS TEXT AS '
> DECLARE
> ParamId INTEGER;
> ParamName TEXT;
> IsFixEnum BIT;
> IsExpandEnum BIT;
> BEGIN
> IF $1 IS NOT NULL THEN
> SELECT INTO ParamId,ParamName,IsFixEnum,IsExpandEnum
> AttributeId,AttributeName,IsFixEnum,IsExpandEnum
> FROM Attributes
> WHERE AttributeId = $1
> ORDER BY AttributeId;
>
> RETURN ''$1 successfull'';
> END IF;
> ......
> ......
> END;
> ' LANGUAGE 'plpgsql';
>
> So when i say SELECT PP_ReadParameter(50,Null)......it should return the
> ParamId,ParamName,....
> But to check the working of the function i just return ''$1 successfull''
> as i dont know how to return the tuple.
>
> Please help me on this
>
>
> With Best Regards
> Pradeep Kumar P J
>

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Stephan Szabo 2004-07-08 13:49:57 Re: FW: need help on stored procedures
Previous Message gavaneh 2004-07-08 05:20:18 array in postgre