开发者

INSERT inside plsql procedure does not tell how many rows were inserted

开发者 https://www.devze.com 2023-01-24 02:12 出处:网络
i am trying to insert some rows 开发者_如何学编程and update some rows inside a pl/sqlloop. howeverall i get to see is the pl/sql procedure is successfully completed.

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)


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;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号