First of all, yes I've read documentation for DO statement :) http://www.postgresql.org/docs/9.1/static/sql-do.html
So my question:
I need to execute some dynamic block of code that contains UPDATE statements and calculate the number of all affected rows. I'm using Ado.Net
provider.
In Oracle the solution would have 4 steps:
- add InputOutput parameter "N" to command
- add BEGIN ... END; to command
- add :N := :N + sql%rowcount after each statement.
- It's done! We can read N parameter from command, after execute it.
How can I do it with PostgreSQL? I'm using npgsql provider but can migrate to devard if it helps.