Number of Records in Insert Statement (Oracle)
Asked Answered
S

1

5

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?

Syndicate answered 23/9, 2009 at 20:41 Comment(2)
Please tell more about the programming language and the environment.Haehaecceity
I work in both PL/SQL and .Net, so both your answers are relivant. Thanks!Syndicate
H
17

Doing an INSERT in PL/SQL SQL%ROWCOUNT gives the number of inserted rows.

Doing an INSERT in C# cmd.ExecuteNonQuery() returns the number of inserted rows.

Haehaecceity answered 23/9, 2009 at 21:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.