Re: [SQL] Some help with functions-syntax

2007-01-18 Thread John DeSoi
On Jan 18, 2007, at 2:38 AM, Jan Meyland Andersen wrote: But the problem here is that the where-clause depends on the relkind. That is why I'm trying to solve the problem this way. I think that clause can be written as a subselect and added to the expression. Or just make that a separate

Re: [SQL] Some help with functions-syntax

2007-01-17 Thread Jan Meyland Andersen
> There are two forms to iterate over the query: > > 1. FOR target IN query LOOP > 2. FOR target IN EXECUTE text_expression LOOP Thanks for your answer. > My suggestion is to eliminate the string you created (_WHERECLAUSE) and > add the proper conditions to the query expression you already have.

Re: [SQL] Some help with functions-syntax

2007-01-17 Thread John DeSoi
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

[SQL] Some help with functions-syntax

2007-01-17 Thread Jan Meyland Andersen
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. DECLARE _relkind char; _RES "EMS"."KeySet"; _WHERECLAUSE text; BEGIN SELE