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?

Answers were Sorted based on User's Feedback



How can i insert data inro a table with 3 columns using FORALL?..

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

How can i insert data inro a table with 3 columns using FORALL?..

Answer / amarnath

in stead of above discription we need to use dynamic sql.

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

List the differences between plsql - function & procedures

2 Answers   TCS, Verizon,


what is the difference between pragma exception_init and raise_application_error

1 Answers   Aetins, State Street,


How do rank () and dense_rank () differ?

0 Answers  


what the meaning of sql

8 Answers  


Show the two pl/sql cursor exceptions.

0 Answers  


how do you know if your mysql server is alive? : Sql dba

0 Answers  


Can we connect to postgresql using sql developer?

0 Answers  


Does truncate release storage space?

0 Answers  


How to return multiple rows from the stored procedure?

0 Answers  


Why is there a need for sqlcode and sqlerrm variables?

0 Answers  


What programs use sql?

0 Answers  


what is a sub query?how will you calculate working days in a month using sub query?

4 Answers   InteQ,


Categories