Re: Some help with functions-syntax - Mailing list pgsql-sql

From John DeSoi
Subject Re: Some help with functions-syntax
Date
Msg-id 2AFADCD2-C72D-40FB-8B8E-D6FD023F2148@pgedit.com
Whole thread Raw
In response to Some help with functions-syntax  ("Jan Meyland Andersen" <jma@agile.dk>)
Responses Re: Some help with functions-syntax  ("Jan Meyland Andersen" <jma@agile.dk>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: "Jan Meyland Andersen"
Date:
Subject: Some help with functions-syntax
Next
From: "Jan Meyland Andersen"
Date:
Subject: Re: Some help with functions-syntax