Re: [pgadmin-support] How to add a function that returns the result of a select statement?

2006-08-18 Thread Henry Andres Sanabria Fuentes
You have to use RETURNS refcursor to return a cursor.ben sewell <[EMAIL PROTECTED]> escribió:Hi Gibson,you need to add into and add a variable assuming your using plpgsql.   create or replace function function_name() returns user as' begin   declare rec user;    select into rec * from u

Re: [pgadmin-support] How to add a function that returns the result of a select statement?

2006-08-18 Thread ben sewell
Hi Gibson,you need to add into and add a variable assuming your using plpgsql.   create or replace function function_name() returns user as' begin   declare rec user;    select into rec * from user;   return rec; end; 'language ' plpgsql';   This should work, I had the same problem the other day.

[pgadmin-support] How to add a function that returns the result of a select statement?

2006-08-18 Thread Gibson
Hi, I've tried using the "New function" option to create a new SQL function that will return the result of a select statement "Select * from user". I've set the return type to be the "user" table. But i keep getting an error about "Syntax error at or near Select". My SQL statement is very sim