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;
精彩评论