Why using this kind of "Insert Statement" ?
I'm learning now to my first Oracle exam wich is the SQL Exam.
in the chapter of DML statements i encountered in a "Insert statement" wich i cannot find anything usefull or far reaching with the option of using subquery insted of the table name... .
The Statement goes like This :
insert into (select empno,ename,job,mgr,hiredate,sal,comm,deptno
where deptno = 30)
My question is :
Is there a good reasone or good use for using subquery insted of table name ?
or is it just for me to know that this option is exsist ?
Last edited by kashkash; 09-16-2003 at 08:51 AM.
It seems like a rather pointless use of the syntax. Essentially you inserting into an in-line view, but the predicate " where deptno = 30" makes no sense -- this doesn't limit the values you can insert at all.
Tnx SlimDave for your reply.
Tho i can add "WITH CHECK OPTION" inside the sentence i still find it pointless.
your reply is strenghening this opinion.
Click Here to Expand Forum to Full Width