插入语句中的记录数(Oracle) [英] Number of Records in Insert Statement (Oracle)
本文介绍了插入语句中的记录数(Oracle)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想报告在Oracle插入语句中插入的记录数.我正在从一条语句插入,因此我可以将select两次运行并进行一次计数,但我宁愿将其全部保留在一条语句中.有办法吗?
I'd like to report on the number of records inserted in an Oracle insert statement. I'm inserting from a statement, so I could run my select twice and a count, but I'd rather keep it all in a single statement. Is there a way?
推荐答案
在PL/SQL SQL%ROWCOUNT
中执行INSERT可获得插入的行数.
Doing an INSERT in PL/SQL SQL%ROWCOUNT
gives the number of inserted rows.
在C#cmd.ExecuteNonQuery()
中执行INSERT会返回插入的行数.
Doing an INSERT in C# cmd.ExecuteNonQuery()
returns the number of inserted rows.
这篇关于插入语句中的记录数(Oracle)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文