Re: [SQL] Stored Procedure Problem

2002-12-13 Thread Rajesh Kumar Mallah.
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.

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Roberto Mello
On Thu, Dec 12, 2002 at 08:13:22PM +0530, Atul wrote: > Hi, > How to return multiple columns through stored procedure. > But This Gives Error(For Multiple column , not for single column) > Please Let me know. You didn't say which version of PostgreSQL you are using. In PG 7.2 you can re

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Tomasz Myrta
Atul wrote: CREATE FUNCTION b_function() RETURNS varchar AS ' DECLARE an_integer int4; an_namevarchar; 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... S

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Atul
Hi,   How to return multiple columns through stored procedure.   Consider EX.   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_integ

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Héctor Iturre
Hi, use this CREATE FUNCTION b_function() RETURNS int4 AS ' DECLARE an_integer int4; BEGIN select into an_integer emp_id from employee; return an_integer; END; ' LANGUAGE 'plpgsql'; --- Atul <[EMAIL PROTECTED]> escribió: > Hello, > > Atul Here, I have one

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Christoph Haller
> CREATE FUNCTION b_function() RETURNS int4 AS ' > DECLARE >an_integer int4; > BEGIN >select emp_id from employee; >return an_integer; > END; > ' > LANGUAGE 'plpgsql'; > Try SELECT INTO an_integer emp_id from employee; Regards, Christoph ---(end of broadcast)-

[SQL] Stored Procedure Problem

2002-12-12 Thread Atul
Hello,       Atul Here, I have one problem while accessing Database Records Or Recordset from stored procedure. Procedure is like this,   CREATE FUNCTION b_function() RETURNS int4 AS ' DECLARE    an_integer int4; BEGIN    select emp_id from employee;    return an_intege