pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mike Plemmons <mikeplemmons@gmail.com>
To: PostgreSQL List <pgsql-sql@postgresql.org>
Subject: Question about functions
Date: Sun, 16 Oct 2005 23:24:44 -0400
Message-ID: <2f8663320510162024j17b4fdb0n4d2b5df1e32d1863@mail.gmail.com> (raw)

I have been looking through FAQs and the docs and I cannot seem to find the
answer to this question. If someone can point me to documentation I would
really appreciate it.

I am trying to run this function but the return is not correct. If I run the
select statement from the psql command line it works. My guess is that the
WHERE clause could be causing the problem. Then again, it may be how I am
using the FOR loop. The ides column is of type TEXT.

CREATE OR REPLACE FUNCTION sp_description_search(varchar) RETURNS varchar AS
$$
DECLARE
myrec record;
BEGIN
FOR myrec IN SELECT * FROM tblStuff WHERE ides LIKE '%$1%' LOOP
RETURN NEXT myrec;
END LOOP;
RETURN;
END;
$$ LANGUAGE 'plpgsql';

Thanks so much for any insight you can give me!!!
Mike

view thread (5+ messages)  latest in thread

Message-ID: <2f8663320510162024j17b4fdb0n4d2b5df1e32d1863@mail.gmail.com>
Permalink:  ../2f8663320510162024j17b4fdb0n4d2b5df1e32d1863@mail.gmail.com/
Also on:    postgresql.org/message-id/2f8663320510162024j17b4fdb0n4d2b5df1e32d1863@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mikeplemmons@gmail.com
  Subject: Re: Question about functions
  In-Reply-To: <2f8663320510162024j17b4fdb0n4d2b5df1e32d1863@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox