Get count of records affected by INSERT or UPDATE in PostgreSQL

前端 未结 5 1473
挽巷
挽巷 2020-12-01 09:13

My database driver for PostgreSQL 8/9 does not return a count of records affected when executing INSERT or UPDATE.

PostgreSQL offers the n

5条回答
  •  抹茶落季
    2020-12-01 09:33

    I agree w/ Milen, your driver should do this for you. What driver are you using and for what language? But if you are using plpgsql, you can use GET DIAGNOSTICS my_var = ROW_COUNT;

    http://www.postgresql.org/docs/current/static/plpgsql-statements.html

提交回复
热议问题