hi Pavel,
thanks for your answer,
I don't understand exactly how "y" should be declared, and how it
should be returned by the function (as a table,
as a "set of record", or maybe as some kind of generic object, I don't
know exactly what's possible with pl/psql.).
cheers
Tom
2012/4/18 Pavel Steh
2012/4/19 thomas veymont :
> hi Pavel,
>
> thanks for your answer,
>
> I don't understand exactly how "y" should be declared, and how it
> should be returned by the function (as a table,
> as a "set of record", or maybe as some kind of generic object, I don't
> know exactly what's possible with pl
that made it, thank you.
For other readers, here is what I finally did :
CREATE TABLE mytable (...)
CREATE FUNCTION (...) RETURNS SETOF mytable AS $$
DECLARE
r mytable%rowtype
BEGIN
...
FOR r IN select * from mytable
LOOP
RETURN next r;
END LOOP;
RETURN;
END
2012/4/19 thomas veymont :
> that made it, thank you.
> For other readers, here is what I finally did :
>
> CREATE TABLE mytable (...)
>
> CREATE FUNCTION (...) RETURNS SETOF mytable AS $$
> DECLARE
> r mytable%rowtype
> BEGIN
> ...
> FOR r IN select * from mytable
> LOOP
>
>
Hello Tom,
The example you have given is EXACTLY why something like CURRENT is needed to limit the number of
unique queries or prepared statements. (or to do a selection of all values before an update meaning
two executed queries.)
regards,.
Dennis
On 04/18/2012 06:24 PM, Tom Lane wrote:
D
On 04/19/2012 04:55 AM, Dennis wrote:
Hello Tom,
The example you have given is EXACTLY why something like CURRENT is
needed to limit the number of unique queries or prepared statements. (or
to do a selection of all values before an update meaning two executed
queries.)
regards,.
Dennis
On 04/