Search Postgresql Archives

Re: plpgsql returning resultset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Raymond O'Donnell wrote:

Can you show us more of your code?

I figured out how to make it work when using "for" instead of "with".

Here is the code and the error message. I couldnt find anything in the documentation about "with" but I did find something about "for" which I managed to make work. In any case here is the code for the "with" code:

create or replace function get_profile() returns setof tableA as
$$
declare
	val_list	tableA%rowtype;
begin

	with val_list in
	  select * from tableA
	do
	loop
	  return next val_list;
	end loop;

	return;
end;
$$ language 'plpgsql';


the error message is:

psql:functions.sql:116: ERROR:  syntax error at or near "with  $1"
LINE 1: with  $1  in select * from attribute_values_part_seq_1_ff_5 ...
        ^
QUERY: with $1 in select * from attribute_values_part_seq_1_ff_5 do loop return next $1
CONTEXT:  SQL statement in PL/PgSQL function "get_profile" near line 10




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux