Re: execute if statement - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: execute if statement
Date
Msg-id 50BA580D.2050409@iol.ie
Whole thread Raw
In response to execute if statement  (Peter Kroon <plakroon@gmail.com>)
Responses Re: execute if statement
List 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@iol.ie


pgsql-general by date:

Previous
From: Peter Kroon
Date:
Subject: execute if statement
Next
From: Peter Kroon
Date:
Subject: Re: execute if statement