plsql 过程中的 INSERT 不会告诉插入了多少行

发布于 2024-10-01 15:10:57 字数 174 浏览 1 评论 0原文

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

然而我所看到的只是 pl/sql 过程成功完成。

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

服务器输出设置为打开。

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

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荆棘i 2024-10-08 15:10:57

在 Oracle 中,行计数不会像 SQL Server 中那样自动输出。

你应该明确地这样做:

BEGIN
        INSERT
        INTO    mytable
        SELECT  …
        FROM    other_table;
        DBMS_OUTPUT.put_line(SQL%ROWCOUNT);
END;

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;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文