Using a function to delete rows

Поиск
Список
Период
Сортировка
От Derrick Betts
Тема Using a function to delete rows
Дата
Msg-id 005701c38e8a$52f7fa00$0100a8c0@BigOne
обсуждение исходный текст
Ответы Re: Using a function to delete rows  (Oliver Fromme <olli@lurza.secnetix.de>)
Список pgsql-novice
How do I create a function that takes as input (int4) and then deletes rows from several tables.  This is what I have tried, but I can't get it to execute:
 
CREATE OR REPLACE FUNCTION public.deleteclient(int4)
  RETURNS Void AS
'
BEGIN
Delete from clientinfo where caseid = $1;
Delete from caseinfo where caseid = $1;
Delete from tracking where caseid = $1;
Delete from casenotes where caseid = $1;
Delete from creditinfo where caseid = $1;
Delete from debts where caseid = $1;
Delete from education where caseid = $1;
Delete from employer where caseid = $1;
Delete from family where caseid = $1;
Delete from formeremployer where caseid = $1;
Delete from income where caseid = $1;
Delete from other where caseid = $1;
Delete from specialinterests where caseid = $1;
Delete from tracking where caseid = $1;
END'
  LANGUAGE 'plpgsql' VOLATILE;
 
Thanks,
Derrick

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

Предыдущее
От: Oliver Fromme
Дата:
Сообщение: Problem with pg_user (somewhat urgent)
Следующее
От: Godshall Michael
Дата:
Сообщение: Re: Using a function to delete rows