Re: pgpl-problem, what's wrong with my loop? - Mailing list pgsql-sql

From Kovacs Zoltan Sandor
Subject Re: pgpl-problem, what's wrong with my loop?
Date
Msg-id Pine.LNX.4.05.10011201735490.6284-100000@pc10.radnoti-szeged.sulinet.hu
Whole thread Raw
In response to pgpl-problem, what's wrong with my loop?  (Bruno Boettcher <bboett@erm1.u-strasbg.fr>)
Responses Re: pgpl-problem, what's wrong with my loop?
List pgsql-sql
>   FOR arow IN SELECT currency,amount FROM journal WHERE col=sumup LOOP
My opinion is the problem that you cannot give a column name as a
parameter. But I'm not sure. This never worked for me. The thing here
happens that you get all rows if and only if $1=$2 (as strings) and if
they are not equal, the WHERE clause will stand for constant false. This
second case may be the fact for you.

You should write different codes for the different col parameters in my
opinion. Or you might write a C function which can send arbitrary SQL
queries to the backend.

Regards, Zoltan




pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgpl-problem, what's wrong with my loop?
Next
From: Bruno Boettcher
Date:
Subject: Re: pgpl-problem, what's wrong with my loop?