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 the image in table
what are pseudocolumns?
Explain the relationship among Database, Tablespace and Data file?
What is a read only transaction in oracle?
Is there a function to split a string in plsql?
Calculate difference between 2 date / times in oracle sql?
How to rename an index?
How to convert the date format from dd/mm/yyyy to mm/dd/yyyy. (for eg). 22/05/2008 to 05/22/2008. when u use to_char(), it tells the month is invalid. how to resolve this problem.tel with eg.
what is the use of composite key constraint?
What are ACID properties in databases?
What is oracle open database communication (odbc)?
How to create a table interactively?