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
Which tcp/ip port does sql server run on? How can it be changed? : Sql dba
what is blob? : Sql dba
How delete a row in sql?
If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????
What is delete command in sql?
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
What are the benefits of triggers?
What is the command used to fetch first 5 characters of the string?
Is progress software supports to ( pl/sql )?
Can two tables have same primary key?
What is the usage of the distinct keyword?
What is difference sql and mysql?
Is crud a cuss word?
What is procedure and function?
How to download oracle sql developer?