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

Write a pl/sql script to display the following series of numbers: 99,96,93……9,6,3?

1 Answers  


What will you get by the cursor attribute sql%rowcount?

0 Answers  


What kind of join is join?

0 Answers  


What is schema in sql example?

0 Answers  


Does normalization improve performance?

0 Answers  






Differentiate between pl/sql and sql?

0 Answers  


what are all different types of collation sensitivity? : Sql dba

0 Answers  


What is partition by in sql?

0 Answers  


What is secondary key?

0 Answers  


Can we use threading in pl/sql?

0 Answers  


What are the Restrictions on Cursor Variables?

2 Answers  


What is a record in pl/sql?

0 Answers  


Categories