Hi,
I have table called Employee with Emp_name and Salary. I want to sore this into Assocaitive array for comparision. How can it be done:
Tabledata:
Name | SAlary |
---|
David | 5000 |
James | 4300 |
Anderson | 6000 |
Karthik | 7000 |
Data should be stored Like:
Assoc_arr('David') := 5000;
Assoc_arr('James') := 4300;
Assoc_arr('Anderson') := 6000;
Assoc_arr('Karthik') := 7000;
How it can be achieved?
I tried something, its for your reference:
declare
type Asso_arr is table of varchar2(30) index by binary_integer;
type nes_tab is table of varchar2(30);
As_arr Asso_arr;
name nes_tab := nes_tab();
salary nes_tab := nes_tab();
begin
select salary,name bulk collect into salary,name from EMPLOYEE;
/*No idea ,how to copy into Associative array variable from here. Please support. */
end;
/