On 01/12/2012 19:44, Peter Kroon wrote:
> Mmmmm.......
>
> How do I execute dynamic sql that starts with an if statement.
> I'm converting mssql code to pgsql.
>
Without trying it, I'd guess that you need to have the IF outside the
dynamic code, something like this:
if .... then
execute '.....';
end if;
If you show what you're trying to achieve, someone might be able to
suggest something better.
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie