Re: If Statement

Поиск
Список
Период
Сортировка
От Phillip Smith
Тема Re: If Statement
Дата
Msg-id 00f701c748a6$3fdc4640$9b0014ac@wbaus090
обсуждение исходный текст
Ответ на If Statement  ("Greg Quinn" <greg@officium.co.za>)
Список pgsql-novice
Perhaps what you actually want is the CASE function - it performs what most
people with previous programming experience would expect from IF

Cheers,
-p


-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Greg Quinn
Sent: Monday, 5 February 2007 05:16
To: pgsql-novice@postgresql.org
Subject: [NOVICE] If Statement

For some reason I cannot get an IF statement to work in PostGreSQL, even
though I am doing it in the format the manual tells me to...
Here is my query...

IF 1 = 1 THEN
    update contacts set deleted = TRUE
END IF;

I get the error ERROR:  syntax error at or near "IF" at character 1

I am using EMS's PostGreSQL Manager for windows.

Thanks


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee.  If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SPAM-LOW: Re: If Statement
Следующее
От: "Peter Dawn"
Дата:
Сообщение: Fill multiple fields through one INNER JOIN