syntax question - Mailing list pgsql-sql

From James Cooper
Subject syntax question
Date
Msg-id 006401c2db87$fc09be00$c900a8c0@jax
Whole thread Raw
Responses Re: syntax question  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql

FOR total IN EXECUTE subquery LOOP

END LOOP;

RETURN total.tot;

 

I have a function that returns a total from a dynamic query I use to generate the total query

I've tried to modify it as a loop to get a single row value is unnecessary but I'm failing on my syntax

I've tried

select into total subquery

-but it wont work(when I attempt this I remove the select from the beginning of my sub query)

can someone show me the syntax to execute a select into with a string that contains a query in it?

 

James

pgsql-sql by date:

Previous
From:
Date:
Subject: SQL Statements question, why I get errors...
Next
From: Josh Berkus
Date:
Subject: Re: syntax question