A question about PL/pgSQL

Поиск
Список
Период
Сортировка
От Warren Vanichuk
Тема A question about PL/pgSQL
Дата
Msg-id Pine.LNX.4.21.0010271428180.527-100000@urd.street-light.com
обсуждение исходный текст
Ответы Re: A question about PL/pgSQL  (Alex Pilosov <alex@pilosoft.com>)
Re: A question about PL/pgSQL  (Igor Roboul <igor@raduga.dyndns.org>)
Список pgsql-general
Greetings.

I am writting up a function in PL/pgSQL to automate a couple of multi-table
updates, and I have a question.

I need to check to see if the data is already in the database, and if it is,
perform and update, or if it's not, perform an insert.  The lookup is
against a primary key, so I only have to worry about 1 or 0 rows being
returned from the select statement.

I attempted something like

IF SELECT id FROM overview WHERE id = 100 ...

but I get an 'error near SELECT' returned from the database.

Any help would be apprieciated..  :)

Sincerely, Warren


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

Предыдущее
От: Dmitriy Agafonov
Дата:
Сообщение: 7.1 release date ?
Следующее
От: "Vilson farias"
Дата:
Сообщение: CPU killer