Re: execute if statement
От | Peter Kroon |
---|---|
Тема | Re: execute if statement |
Дата | |
Msg-id | CAOh+DOkv9AC=PXnjAQyeZYgzu9VozzesdCQvygj49U5_qk99Wg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: execute if statement (Raymond O'Donnell <rod@iol.ie>) |
Ответы |
Re: execute if statement
Re: execute if statement |
Список | pgsql-general |
Mmmmm.......
How do I execute dynamic sql that starts with an if statement.
I'm converting mssql code to pgsql.
2012/12/1 Raymond O'Donnell <rod@iol.ie>
I think EXECUTE used like this is available only in a function: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;
>
> ';
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 по дате отправления: