Question about functions - Mailing list pgsql-sql

From Mike Plemmons
Subject Question about functions
Date
Msg-id 2f8663320510162024j17b4fdb0n4d2b5df1e32d1863@mail.gmail.com
Whole thread Raw
Responses Re: Question about functions
Re: Question about functions
List 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 by date:

Previous
From: "Dau Sy Manh"
Date:
Subject: Re: copy tables
Next
From: "Stewart Ben (RBAU/EQS4) *"
Date:
Subject: Re: Question about functions