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