Re: CREATE FUNCTION Fails with an Insert Statement in it
В списке pgsql-general по дате отправления:
| От | Merlin Moncure |
|---|---|
| Тема | Re: CREATE FUNCTION Fails with an Insert Statement in it |
| Дата | |
| Msg-id | b42b73150701230901w51f434fsee0835b790ae23e7@mail.gmail.com обсуждение |
| Ответ на | CREATE FUNCTION Fails with an Insert Statement in it ("Jasbinder Singh Bali" <jsbali@gmail.com>) |
| Список | pgsql-general |
On 1/23/07, Jasbinder Singh Bali <jsbali@gmail.com> wrote: > I have created the following function : > > > CREATE OR REPLACE FUNCTION sp_insert_tbl_l_header(int4,text) > RETURNS bool AS > $BODY$ > INSERT INTO tbl_xyz > (unmask_id,email_from) > VALUES ($1,$2) > $BODY$ > LANGUAGE 'sql' VOLATILE; > > when i try to create this fucntion by running this script, i get the > following error: > > ERROR: return type mismatch in function declared to return boolean > DETAIL: Function's final statement must be a SELECT. > CONTEXT: SQL function "sp_insert_tbl_xyz" > > So i think there is some problem with the return type of the function > when it has an insert statement but really don't know what should be > the return type of this function. declare the function to return void. merlin
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера