How to create index-by table in oracle?
Answers were Sorted based on User's Feedback
Answer / santosh kumar
declare
type str is table of number index by binary_integer;
tab_res str; ---------declaring variable....
min_eid number;
max_eid number;
begin
select min(employee_id),max(employee_id) into
min_eid,max_eid
from employees;
for i in min_eid..max_eid loop
select salary into tab_rec(i) from employees
where employee_id=i;
end;
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / su
declare
TYPE tab IS TABLE OF varchar2(200)
INDEX BY binary_integer;
t tab;
v_counter number : =0;
BEGIN
FOR c_emp IN (SELECT ENAME FROM emp)
LOOP
v_counter := v_counter + 1;
t(v_counter):= c_emp.ename;
END LOOP;
FOR i IN 1 .. t.last
LOOP
dbms_output.put_line(t(i));
END LOOP;
EXCEPTION
WHEN others THEN
dbms_output.put_line(sqlcode);
dbms_output.put_line(sqlerrm);
END;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sourav mukhopadhyay
Create index INDEXNAME
ON table(column-name);
Is This Answer Correct ? | 1 Yes | 6 No |
How to insert a new row into a table in oracle?
How do I spool in oracle?
Hi can anyone tell me where are the dumps found of OCA certification.. Also the materials to be studied for the preparation.
Explain the use of control file?
What is system tablespace?
A VIEWS takes memory in the database. If yes, how can u proove it? is there any way to display the size of views?
How to increment dates by 1 in oracle?
What is the fastest query method to fetch data from the table?
WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?
It's Urgent? How to IMPORT .xls & .txt file into ORACLE?
write sql query following source are EmpID, Salary 101 1000 102 2000 103 3000 I want the output format like following empid,sal,composite_sal 101 1000 1000 102 2000 3000 103 3000 6000
How to drop an existing table in oracle?