pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: John DeSoi <desoi@pgedit.com>
To: Jan Meyland Andersen <jma@agile.dk>
Cc: pgsql-sql@postgresql.org
Subject: Re: Some help with functions-syntax
Date: Wed, 17 Jan 2007 19:50:40 -0500
Message-ID: <2AFADCD2-C72D-40FB-8B8E-D6FD023F2148@pgedit.com> (raw)
In-Reply-To: <1364.62.66.218.59.1169073199.squirrel@mail.agile.dk>
References: <1364.62.66.218.59.1169073199.squirrel@mail.agile.dk>
Take a look at the documentation and examples again:
http://www.postgresql.org/docs/8.2/interactive/plpgsql-control-
structures.html#PLPGSQL-RECORDS-ITERATING
There are two forms to iterate over the query:
1. FOR target IN query LOOP
2. FOR target IN EXECUTE text_expression LOOP
In your code you have mixed the two together. You appear to be trying
to concatenate a string on to the end of a query expression. My
suggestion is to eliminate the string you created (_WHERECLAUSE) and
add the proper conditions to the query expression you already have.
On Jan 17, 2007, at 5:33 PM, Jan Meyland Andersen wrote:
> I have some problem with writing a function.
>
> I have made this function which I can't get it to work.
>
> This is probaly a triviel question but i'm new to plsql, so this is a
> showstopper for me.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
view thread (4+ messages) latest in thread
Message-ID: <2AFADCD2-C72D-40FB-8B8E-D6FD023F2148@pgedit.com> Permalink: ../2AFADCD2-C72D-40FB-8B8E-D6FD023F2148@pgedit.com/ Also on: postgresql.org/message-id/2AFADCD2-C72D-40FB-8B8E-D6FD023F2148@pgedit.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: desoi@pgedit.com, jma@agile.dk Subject: Re: Some help with functions-syntax In-Reply-To: <2AFADCD2-C72D-40FB-8B8E-D6FD023F2148@pgedit.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