How can i insert data inro a table with 3 columns using
FORALL?
Answers were Sorted based on User's Feedback
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 |
Answer / amarnath
in stead of above discription we need to use dynamic sql.
| Is This Answer Correct ? | 6 Yes | 2 No |
List the differences between plsql - function & procedures
what is the difference between pragma exception_init and raise_application_error
1 Answers Aetins, State Street,
How do rank () and dense_rank () differ?
what the meaning of sql
Show the two pl/sql cursor exceptions.
how do you know if your mysql server is alive? : Sql dba
Can we connect to postgresql using sql developer?
Does truncate release storage space?
How to return multiple rows from the stored procedure?
Why is there a need for sqlcode and sqlerrm variables?
What programs use sql?
what is a sub query?how will you calculate working days in a month using sub query?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)