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

Give an example of Full Outer Join?

1 Answers   IBM,


How to add, remove, modify users using sql?

0 Answers  


how many triggers are allowed in mysql table? : Sql dba

0 Answers  


What is a left inner join?

0 Answers  


What is compute?

0 Answers  






How can you tell the difference between an index and a view?

0 Answers  


Which one of the following pairs of aggregate functions do you use with character fields? 1. COUNT(field) and MAX(field) 2. AVG(field) and COUNT(field) 3. MIN(field) and SUM(field) 4. AVG(field) and MAX(field) 5. COUNT(field) and SUM(field)

6 Answers   HCL,


What is a schema sql?

0 Answers  


What are advantages of Stored Procedures?

3 Answers   Satyam,


what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba

0 Answers  


Is foreign key mandatory?

0 Answers  


How can you load multi line records? : aql loader

0 Answers  


Categories