Insert Statement
Following are some typical Insert statments :
REM Inserting Values Examples
INSERT INTO dept
VALUES (50, 'PRODUCTION', 'SAN FRANCISCO');
INSERT INTO emp (empno, ename, job, sal, comm, deptno)
VALUES (7890, 'JINKS', 'CLERK', 1.2E3, NULL, 40);
INSERT INTO (SELECT empno, ename, job, sal, comm, deptno FROM emp)
VALUES (7890, 'JINKS', 'CLERK', 1.2E3, NULL, 40);
REM Inserting Values with a Subquery Example
INSERT INTO bonus
SELECT ename, job, sal, comm
FROM emp
WHERE comm > 0.25 * sal
OR job IN ('PRESIDENT', 'MANAGER');
REM Inserting into a Remote Database Example
INSERT INTO scott.accounts@sales (acc_no, acc_name)
VALUES (5001, 'BOWER');
REM Inserting Sequence Values Example
INSERT IdNTO emp
VALUES (empseq.nextval, 'LEWIS', 'CLERK',
7902, SYSDATE, 1200, NULL, 20);
REM Inserting into a Partition Example
INSERT INTO sales PARTITION (oct98)
SELECT * FROM latest_data;
REM Inserting Using Bind Variables Example
INSERT INTO emp VALUES (empseq.nextval, 'LEWIS', 'CLARK',
7902, SYSDATE, 1200, NULL, 20)
RETURNING sal*12, job INTO :bnd1, :bnd2;
REM Returning Values into a Bind Array Example
INSERT INTO employee
VALUES ('Kitty Mine', 'Peaches Fuzz', 'Meena Katz')
RETURNING employee INTO :1;