Returning a bool on DELETE in a proc.

Поиск
Список
Период
Сортировка
От KÖPFERL Robert
Тема Returning a bool on DELETE in a proc.
Дата
Msg-id ED4E30DD9C43D5118DFB00508BBBA76EB16564@neptun.sonorys.at
обсуждение исходный текст
Ответы Re: Returning a bool on DELETE in a proc.  ("Keith Worthington" <keithw@narrowpathinc.com>)
Re: Returning a bool on DELETE in a proc.  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-sql
Hi,

I'm currently writing a function which encapsulates a delete and should
return a bool as indicator for success.

I tried:
    DELETE FROM "TariffDetails" WHERE "TariffId"=$1 and "BNumberPrefix"=$2;    SELECT TRUE;

but this makes me not happy.
How can I distingruish wehter DELETE affected 0 or more rows and return that
while DELETE is not capable of returning any value?

And is the whole function executed if the DELETE fails or will it stop
bevore the select?

I had a read throu SQL-functions while nothing matched me.


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

Предыдущее
От: KÖPFERL Robert
Дата:
Сообщение: Re: query configuration for validate empty quote to zero
Следующее
От: "Keith Worthington"
Дата:
Сообщение: Re: Returning a bool on DELETE in a proc.