dbms_sql.number_table中的count(*) [英] count(*) in dbms_sql.number_table

查看:81
本文介绍了dbms_sql.number_table中的count(*)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经声明了一个数字表,例如:

I have declared a number table like:

v_areas_hijas   dbms_sql.number_table;

我填写表格,然后尝试使用以下方法获取该表格的大小:

I fill the table and then I'm trying to get the size of that table with:

select count(*) into v_counter from v_areas_hijas;

但是我得到了:

错误(23,37):PL/SQL:ORA-00942:表或视图不存在

Error(23,37): PL/SQL: ORA-00942: table or view does not exist

我应该怎么得到那个尺寸?

How should I get that size?

推荐答案

显然,集合的count方法有效.

Apparently the count method of the collection works.

declare
    p_ids dbms_sql.number_table;
    cnt NUMBER;
begin
    p_ids(1) := 2;
    p_ids(2) := 3;
    p_ids(3) := 4;
    dbms_output.put_line('cnt '||p_ids.count);
end;
/

返回

 cnt 3

这篇关于dbms_sql.number_table中的count(*)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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