在plsql过程中插入INSERT不会告诉您插入了多少行 [英] INSERT inside plsql procedure does not tell how many rows were inserted

查看:123
本文介绍了在plsql过程中插入INSERT不会告诉您插入了多少行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在pl/sql循环中插入一些行并更新一些行.

i am trying to insert some rows and update some rows inside a pl/sql loop.

无论如何,我只能看到pl/sql过程已成功完成.

however all i get to see is the pl/sql procedure is successfully completed.

我确实可以看到dbmbs_ouput语句,但是看不到插入和/或更新查询的输出状态.

i do get to see dbmbs_ouput statements but not the output status of insert and/or update queries.

服务器输出设置为开.

我如何查看插入和更新行的状态(即插入和更新了多少行)

how do i get to see the status of insert and update rows(namely how many rows were inserted and updated)

推荐答案

在Oracle中,不会自动输出rowcount,就像在SQL Server中一样.

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;

这篇关于在plsql过程中插入INSERT不会告诉您插入了多少行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆