Question about functions
От | Mike Plemmons |
---|---|
Тема | Question about functions |
Дата | |
Msg-id | 2f8663320510162024j17b4fdb0n4d2b5df1e32d1863@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Question about functions
Re: Question about functions |
Список | pgsql-sql |
I have been looking through FAQs and the docs and I cannot seem to find the answer to this question. If someone can pointme to documentation I would really appreciate it.<br /><br /> I am trying to run this function but the return is notcorrect. If I run the select statement from the psql command line it works. My guess is that the WHERE clause couldbe causing the problem. Then again, it may be how I am using the FOR loop. The ides column is of type TEXT.<br /><br/> CREATE OR REPLACE FUNCTION sp_description_search(varchar) RETURNS varchar AS $$<br /> DECLARE<br /> myrec record;<br/> BEGIN<br /> FOR myrec IN SELECT * FROM tblStuff WHERE ides LIKE '%$1%' LOOP<br /> RETURN NEXT myrec;<br /> ENDLOOP;<br /> RETURN;<br /> END;<br /> $$ LANGUAGE 'plpgsql';<br /><br /> Thanks so much for any insight you can give me!!!<br/> Mike<br />
В списке pgsql-sql по дате отправления: