Re: ERROR: syntax error at or near "IF"... why?

Поиск
Список
Период
Сортировка
От Johan Nel
Тема Re: ERROR: syntax error at or near "IF"... why?
Дата
Msg-id gtbj2j$48n$1@news.eternal-september.org
обсуждение исходный текст
Ответ на Re: ERROR: syntax error at or near "IF"... why?  ("DaNieL..!" <daniele.pignedoli@gmail.com>)
Список pgsql-general
DaNieL..! wrote:
> I tryed the declare, before and after the BEGIN;, but allways returns
> me the error:
> -----------------------------------------------------------
> ERROR: syntax error at or near "int";
> LINE 1: DECLARE _mycredit int;
>                                            ^
> -----------------------------------------------------------
>
> For the if statement, i've tryed that
> IF 2 = 2 THEN
>  ROLLBACK;
> END IF
>
> but still the error near the "IF"..
> dunno.. in mysql the if can be used in that way.. in postgres no?

Sorry was thinking FUNCTION way of doing it.  DECLARE can only be used
in a stored procedure/function.

Johan

В списке pgsql-general по дате отправления:

Предыдущее
От: Dennis Brakhane
Дата:
Сообщение: Re: delete duplicates takes too long
Следующее
От: Alan Hodgson
Дата:
Сообщение: Re: possible consistency problem