开发者

Why are arrays indexed by datatype?

TYPE  emp_type_rec IS TABLE OF
employees%rowtype
INDEX BY BINARY_INTEGER;

When we define an array, why is it indexed b开发者_高级运维y some datatype?


Because you have a choice of data types to index by. For example:

DECLARE
    TYPE empno_rec_type IS TABLE OF employees.empno%type INDEX BY VARCHAR2(10);
    empno_rec empno_rec_type;
BEGIN
    empno_rec('SMITH') = 123;
    empno_rec('JONES') = 456;
END;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜