Re: Loop through records - Mailing list pgsql-novice

From Tom Lane
Subject Re: Loop through records
Date
Msg-id 27663.1131809406@sss.pgh.pa.us
Whole thread Raw
In response to Re: Loop through records  (Emiliano Amilcarelli <amiemi@tin.it>)
List pgsql-novice
Emiliano Amilcarelli <amiemi@tin.it> writes:
> I managed to get results printed out from the function,

What was the problem exactly?  I couldn't see a reason for that error
message --- the only thing I could find wrong in your function was
spelling ">=" with a space in the middle.  After fixing that and making
a simple ERRORS table, it worked fine.

> but now i cannot If..THEN working inside the same function.

It looks like you're expecting FOUND to be set inside the loop, which it
is not.  Seems rather pointless --- if you're inside the loop body at
all, then it found a record, no?  A FOR-loop sets FOUND *when it exits*,
to tell code after the loop whether any iterations were performed or
not.

            regards, tom lane

pgsql-novice by date:

Previous
From: Emiliano Amilcarelli
Date:
Subject: Re: Loop through records
Next
From: Reed Kempf
Date:
Subject: postgresql database password