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

What can sql server reporting services do?

1055


Can we change the table name in sql?

888


How many types of cursors are available in pl/sql?

1042


Does asenumerable execute the query?

983


What is field delimiter?

989


Do triggers have restrictions on the usage of large datatypes, such as long and long raw?

1114


Advantages and disadvantages of stored procedure?

1058


What is difference between rank () row_number () and dense_rank () in sql?

1049


Is it mandatory for the primary key to be given a value when a new record is inserted?

1139


What is clustered and nonclustered index in sql?

894


Why do you partition data?

966


Why commit is not used in triggers?

992


What is a delimiter in sas?

979


What is clustered index in sql?

1001


Can we use having without group by in sql?

927