Re: deleting function

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: deleting function
Дата
Msg-id 49F21F0A.8070604@iol.ie
обсуждение исходный текст
Ответ на deleting function  (pavunkumar <pavun.bks@gmail.com>)
Список pgsql-general
On 24/04/2009 14:03, pavunkumar wrote:
> create or replace function newd(id integer ) returns void as $$
> begin
> delete from testing where id=$1;
> end;

I'd guess it's because the column name, "id", is the same as the
argument name - plpgsql thinks that "id" in the DELETE statement is the
argument, so in effect you're doing -

  delete from testing where true;

- with the results you saw. Give the argument a different name and you
should be OK.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

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

Предыдущее
От: Decibel!
Дата:
Сообщение: Can't use "any" with SQL functions
Следующее
От: Decibel!
Дата:
Сообщение: Re: Determining the names of columns in a dynamic query