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
How do I know if I have sql express or standard?
Does oracle use sql?
Explain what is a subquery ?
What is record in pl sql?
Is grant a ddl statement?
What is identity column in sql server?
Why stored procedure is faster than query?
Mention what does plv msg allows you to do?
how to show all tables with 'mysql'? : Sql dba
What is the location of pre_defined_functions.
what is rdbms? : Sql dba
What is server name sql?
Can we alter stored procedure?
What is sql and db2?
Inline the values in PL/SQL, what does it mean.?