Declaration of an associative array [message #274287] |
Mon, 15 October 2007 06:40  |
 |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
received via PM | In case we need to store some decimal numbers(such as 'amount') in the associative array,can we declare the associative array this way....
TYPE loan_table IS TABLE OF NUMBER(13,2) INDEX BY binary_integer;
a_num_loan loan_table;
please reply. Thank you.
| Why don't you try it out?
SQL> set serverout on
SQL> DECLARE
2 TYPE my_table_type IS TABLE OF NUMBER(12,3) INDEX BY BINARY_INTEGER;
3 my_table my_table_type;
4 BEGIN
5 my_table(5) := 123.5;
6 dbms_output.put_line(to_char(my_table(5)));
7 END;
8 /
123.5
PL/SQL procedure successfully completed.
SQL>
MHE
|
|
|
|
|
|