鉴于这种:
DECLARE
TYPE T_ARRAY IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER;
MY_ARRAY T_ARRAY;
V_COUNT INTEGER;
我想要做:
BEGIN
-- ... some code filling the MY_ARRAY array
-- obviously COUNT_ELEMENTS() does not exists, this is what I'm looking for :-)
V_COUNT := COUNT_ELEMENTS(MY_ARRAY);
DBMS_OUTPUT.PUT_LINE('My array containts ' || V_COUNT || ' elements.');
END;
有没有比创建一个执行基本循环递增计数器的过程更好的方法呢?也许PL / SQL本机功能已经做到了COUNT_ELEMENTS()
?