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 |
What is ADDM Advisor in Oracle?
WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?
What is Database Link ?
What is difference between SQL and SQL*PLUS?
what diffrence between function and procedure?
What are the uses of synonyms?
T1: T2 A X--- this is updated record B B like this T1 table having no.of records updated. write a query"retrive updated record from T2"
How to restrict the duplicate records in table valuesets
t1 col1 col2 nishi 5000 lucky 6700 akash 7000 i want that a query that when i insert 7000 it will show me data already present and data will not insert. if data is not present it will insert.
What is oracle update statement with inner join ?
There is a big table with "n" of rows and 40 + columns .It doesn't have primary key.How do you select the primary key. In other words how do you get the duplicate records.
What is a Data File ?