Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to create index-by table in oracle?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to initialize variables with default values?

1300


How many types of table in Oracle?

1169


how do u setup a replication site?

2027


Explain implicit cursor.

1069


How many types of auditing in Oracle?

1084


How to load data through external tables?

1181


What is the usage of merge statement?

1200


How to use like conditions in oracle?

1108


What is the max number of columns in an oracle table?

1039


What is not equal to in oracle?

1047


What is the purpose of tables, private synonyms and public synonyms in Oracle?

1089


What is a table index?

1161


How i can handle exception in large code like 1000 line without distrubing the code or without exception handler sction?

3244


What is a subquery?

1185


how may join possible between (requisition with purchase order)

2325