Categories

JAVA DATEBASE
Technology Network Community
Oracle Database
Fusion Middleware
Development Tools
Java
Desktop
Server & Storage Systems
Enterprise Management
Berkeley DB Family
Cloud Computing
Big Data
Business Intelligence
Architecture
Migration and Modernization
E-Business Suite
Siebel
PeopleSoft Enterprise
JD Edwards World
Industries
JD Edwards EnterpriseOne
User Productivity Kit Pro (UPK) and Tutor
Governance, Risk & Compliance (GRC)
Master Data Management (MDM)
Oracle CRM On Demand
On Demand: SaaS and Managed Applications
AutoVue Enterprise Visualization
Primavera
ATG
Agile PLM
Endeca Experience Management
Fusion Applications
Archived Forums

 



Tags

General Questions


subquery in insert into clause


what is the use of using subquery in insert into clause.  e.g. insert into (select empno from emp)     values(1234)  regards  kiran

Not really of common use, I think, but WITH CHECK OPTION option could be one reason for using that. Let's see an example :  SQL> INSERT INTO   2  (SELECT empno, ename, deptno FROM emp WHERE deptno < 20)   3* VALUES (1111, 'Brown', 30) SQL> /    1 row created.  That's the same as  SQL> insert into emp (empno, ename, deptno)   2  values(1111, 'Brown', 30);  But  SQL> INSERT INTO   2  (SELECT empno, ename, deptno FROM emp WHERE deptno < 20 WITH CHECK OPTION)   3* VALUES (2222, 'Green', 30) SQL> /  (SELECT empno, ename, deptno FROM emp WHERE deptno < 20                                   * ERROR at line 2: ORA-01402: view WITH CHECK OPTION where-clause violation     SQL>   Paul

thanx paul for helping me out...

You're welcome.


Related Links

ORA-12518: TNS:listener could not hand off client connection
sql is running very slow
Oracle database product feature matrix
Unable to extend
Change default spool extension
ORA-00904: "OCT": invalid identifier
FAILED - ORA-01031: insufficient privileges
ORA-19815: WARNING: db_recovery_file_dest_size of 4070572032 bytes is 100.0
Can we use PRAGMA RESTRICT_REFERENCES in either procedure or Function.
TEMP tablespace
Searching Criteria to find out the friends of friend
Local Partitioned indexes (adding additional partitions)
database freezed for row cache lock
Simple archive issue
V$SQL.CHILD_NUMBER
"_offline_rollback_segments" and "_corrupted_rollback_segments"