Insert and Insert All with Example
Insert and Insert All with Example
--====================================================
-- Table
Structure and data
--====================================================
select * from XXSD_EMP_TL
select * from XXSD_DEPT_TL
--====================================================
-- Insert
--====================================================
Insert into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (801, 'Ajay', '1000');
Insert into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (802, 'Sachin', '1000');
Insert into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (803, 'Alok', '1000');
Insert into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (804, 'Naveen', '1000');
Insert into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (805, 'Rahul', '1000');
Insert into XXSD_DEPT_TL (DNAME
, LOC ) VALUES ( 'Finance', 'Ghaziabad')
--====================================================
-- INSERT
ALL use Single Table with Dual
--====================================================
Insert into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (805, 'Rahul', '1000');
select * from XXSD_EMP_TL
insert ALL
into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (701, 'Ajay', '1000')
into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (702, 'Sachin', '1000')
into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (703, 'Alok', '1000')
into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (704, 'Naveen', '1000')
into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (705, 'Rahul', '1000')
select * from dual
COMMIT
--====================================================
-- INSERT
ALL use
Multi Table with Dual
--====================================================
select * from XXSD_EMP_TL
select * from XXSD_DEPT_TL
insert ALL
into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (901, 'Manisha', '1100')
into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (902, 'Rena', '1100')
into XXSD_EMP_TL (EMPNO,ENAME
, SAL ) VALUES (903, 'Aarti', '1100')
into XXSD_DEPT_TL (DNAME
, LOC ) VALUES ( 'HR', 'DELHI')
into XXSD_DEPT_TL (DNAME
, LOC ) VALUES ( 'Finance', 'Ghaziabad')
select * from dual
Comments
Post a Comment