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 can i insert data inro a table with 3 columns using
FORALL?

Answer Posted / ashutosh

you can use 3 different collections for it...

suppose the table is emp have the following columns
1. empname varchar
2. empid number
3. sal number

declare
type name_typ is table of emp.empname%type;
type id_typ is table of emp.empid%type;
type sal_typ is table of emp.sal%type;
name_tab name_typ;
id_tab id_typ;
sal_tab sal_typ;
begin
name_tab := name_typ('ramit','rohan');
id_tab := id_typ(10,20);
sal_tab := sal_typ(21000,22000);
for all i in name_tab.first .. name_tab.last
insert into emp values(name_tab(i),id_tab(i),sal_tab(i));
end;

Is This Answer Correct ?    39 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create an array in pl/sql?

1058


what are the features and advantages of object-oriented programming? : Sql dba

994


Which version of sql do I have?

1047


What is a recursive stored procedure?

1167


What is primary and foreign key?

1057


Is it possible to read/write files to-and-from PL/SQL?

1095


What are its different types of dbms?

996


What is the use of desc in sql?

971


what are aggregate and scalar functions? : Sql dba

1051


how to use case expression? : Sql dba

1010


explain the difference between bool, tinyint and bit. : Sql dba

981


How does cross join work in sql?

1007


Can we use delete in merge statement?

1033


what is 'trigger' in sql? : Sql dba

1075


What is the difference between function and procedure in pl/sql?

1067