plpgsql (postgresql 8.3 but I can upgrade)
I can open a cursor with a dynamic query (table / column variable) :
-open cursor for execute '...' ;
But if I want do updates...
- execute 'update ...' where current of cursor ??
Mmm I don't find the way.
Another approach :
-execute 'declare cursor ...' +with hold -for update :(
-execute 'update ... where current of cursor'
But how can I get the reference of the cursor into the function context?
I remember something like synchronizing contexts, but this time I couldn't find nothing about it.
The classical approach :
-for i in execute '...' loop
But to perform an update, I must apply a where clause with its performance penalty, I get no advantage on the current loop.
What do you think about this?
I can open a cursor with a dynamic query (table / column variable) :
-open cursor for execute '...' ;
But if I want do updates...
- execute 'update ...' where current of cursor ??
Mmm I don't find the way.
Another approach :
-execute 'declare cursor ...' +with hold -for update :(
-execute 'update ... where current of cursor'
But how can I get the reference of the cursor into the function context?
I remember something like synchronizing contexts, but this time I couldn't find nothing about it.
The classical approach :
-for i in execute '...' loop
But to perform an update, I must apply a where clause with its performance penalty, I get no advantage on the current loop.
What do you think about this?
Comment