问题
i am trying to insert some rows and update some rows inside a pl/sql loop.
however all i get to see is the pl/sql procedure is successfully completed.
i do get to see dbmbs_ouput statements but not the output status of insert and/or update queries.
the serveroutput is set to on.
how do i get to see the status of insert and update rows(namely how many rows were inserted and updated)
回答1:
In Oracle, the rowcount
is not output automatically like it is in SQL Server
.
You should do it explicitly:
BEGIN
INSERT
INTO mytable
SELECT …
FROM other_table;
DBMS_OUTPUT.put_line(SQL%ROWCOUNT);
END;
来源:https://stackoverflow.com/questions/4139945/insert-inside-plsql-procedure-does-not-tell-how-many-rows-were-inserted