| От | Merlin Moncure |
|---|---|
| Тема | Re: SQL function and "UPDATE...RETURNING" |
| Дата | |
| Msg-id | b42b73150708020959i9c73a56t7eadb63fda10dfa2@mail.gmail.com обсуждение исходный текст |
| Ответ на | SQL function and "UPDATE...RETURNING" (Vincenzo Romano <vincenzo.romano@gmail.com>) |
| Список | pgsql-general |
On 8/2/07, Vincenzo Romano <vincenzo.romano@gmail.com> wrote: > Hi all. > > Is there a way to write an SQL function like this: > > create or replace function afunction( recid bigint ) > returns bigint as $body$ > update atable set afield=0 where recid=$1 returning anotherfield; > $body$ language SQL; > > If i write the function this way, postgres will complain that > the update stetement won't return values. > > I also understand that by switching to PLPGSQL I would b able to > do write the function. But I'd prefer SQL in this case. It's not really possible to do it that way :( merlin
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера