Re: execute if statement

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Peter Kroon <plakroon(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: execute if statement
Date: 2012-12-01 19:18:37
Message-ID: 50BA580D.2050409@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/12/2012 19:11, Peter Kroon wrote:
> How can I achieve this?
>
> EXECUTE '
>
> if 1=1 then
> raise notice ''%'', ''notice has been raised...'';
> end if;
>
> ';

I think EXECUTE used like this is available only in a function:

create or replace function my_function()
returns void
as
$$
begin
execute ....
end;
$$
language plpgsql;

In "ordinary" SQL, EXECUTE executes a prepared statement.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Kroon 2012-12-01 19:44:15 Re: execute if statement
Previous Message Peter Kroon 2012-12-01 19:11:01 execute if statement