Re: [GENERAL] PL/pgSQL - Help or advice please on using unbound cursors

2012-07-25 Thread Andrew Hastie
Yep, that fixed it. Many thanks for the pointer. From a performance point of view, I did look at using MOVE rather than FETCH before I call UPDATE as I don't actually need to read the data before applying the update. However in this situation, the ROW_COUNT is always zero and can't be used whi

Re: [GENERAL] PL/pgSQL - Help or advice please on using unbound cursors

2012-07-23 Thread Pavel Stehule
Hello dynamic SQL has not impact on FOUND variable - use GET DIAGNOSTICS varname = ROW_COUNT instead. Regards Pavel Stehule 2012/7/23 Andrew Hastie : > Hi all, > > Apologies if the answer to my question is "obvious", but I'm fairly new to > writing functions in PG. I think my problem is has a

[GENERAL] PL/pgSQL - Help or advice please on using unbound cursors

2012-07-23 Thread Andrew Hastie
Hi all, Apologies if the answer to my question is "obvious", but I'm fairly new to writing functions in PG. I think my problem is has a simple solution, but I'm damned if I can find it :-/ (Postgres v9.1.1 on Linux 64-bit) I'm trying to write a function which will :- 1. Take 3 input params;