oracle oracle10g中如何使用引用游标获取记录数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1062142/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 18:29:34  来源:igfitidea点击:

How to get record count using reference cursor in oracle10g

oracleoracle10g

提问by Sanjay Thakur

I want to know how we can get record count using reference cursor in oracle10g.

我想知道如何在 oracle10g 中使用引用游标获取记录数。

回答by

After you fetched the rows you can use cursorname%rowcount to get the amount of records you fetched.

获取行后,您可以使用cursorname%rowcount 获取获取的记录数量。

回答by Thilo

You cannot.

你不能。

You can only count the rows while you fetch them from the cursor.

您只能在从游标中获取行数时计算行数。

A cursor is like a stream, and Oracle does not know how much rows are in there until it has read them all (which happens as you fetch rows).

游标就像一个流,Oracle 在读取所有行之前不知道其中有多少行(这在您获取行时发生)。