Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread David Johnston
Create function a(int) Returns TABLE(col1 text) As $$ ... $$ Language 'plpgsql' On May 24, 2011, at 4:08, Adarsh Sharma wrote: > Dear all, > > I need to return the rows of a table which was also created in that procedure. > > I know it is very easy when the table is existed before and we c

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread Alban Hertroys
On 24 May 2011, at 10:08, Adarsh Sharma wrote: > Dear all, > > I need to return the rows of a table which was also created in that procedure. > > I know it is very easy when the table is existed before and we can specify > like this to return > > create function a(integer) returns setof exist_

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread Pavel Stehule
Hello 2011/5/24 Adarsh Sharma : > Pavel Stehule wrote: >> >> Hello >> >> you have to use a dynamic sql >> >> look on statement >> >> FOR r IN EXECUTE >> or RETURN QUERY EXECUTE >> > > Can u explain in the example, I find it difficult to understand . > > I think we have to specify  return type whil

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread Adarsh Sharma
Pavel Stehule wrote: Hello you have to use a dynamic sql look on statement FOR r IN EXECUTE or RETURN QUERY EXECUTE Can u explain in the example, I find it difficult to understand . I think we have to specify return type while creating procedures. Thanks Regards Pavel Stehule 2011/5

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread Pavel Stehule
Hello you have to use a dynamic sql look on statement FOR r IN EXECUTE or RETURN QUERY EXECUTE Regards Pavel Stehule 2011/5/24 Adarsh Sharma : > Dear all, > > I need to return the rows of a table which was also created in that > procedure. > > I know it is very easy when the table is existed

[GENERAL] Returning Rows in Procedure

2011-05-24 Thread Adarsh Sharma
Dear all, I need to return the rows of a table which was also created in that procedure. I know it is very easy when the table is existed before and we can specify like this to return create function a(integer) returns setof exist_table as $$ But it gives error when the table is also creat