executing a function

Поиск
Список
Период
Сортировка
От adivi
Тема executing a function
Дата
Msg-id 006b01c345db$10851f60$5d0410ac@maximizelearning.com
обсуждение исходный текст
Ответы Re: executing a function  (Matthew Horoschun <mhoroschun@canprint.com.au>)
Список pgsql-sql
Hi,
    i doubt if this should 've gone to the novice group, but it's all sql
 
 
    i have a function that returns a setof rows from a table testtab :
____________________________________________________________________________________
   CREATE FUNCTION "public"."gettesttab" () RETURNS SETOF public.testtab AS'
        select * from TestTab;
    'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
____________________________________________________________________________________
 
"volatile" etc. was added by the EMS PostGreSql Manager.
 
i try to execute this function
 
but a call
"select * from gettesttab();"
or
"select gettesttab();"
return the error

ERROR:  syntax error at or near "select"
 
the postmaster window also logs the erros:
ERROR:  syntax error at or near "select"
WARNING:  plpgsql: ERROR during compile of gettesttab near line 1
 
can simeone please help me out with this. 
 
thanks in advance
   
regards
-pawan

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

Предыдущее
От: Rudi Starcevic
Дата:
Сообщение: Logging select statements
Следующее
От: Matthew Horoschun
Дата:
Сообщение: Re: executing a function