-
Why using this kind of "Insert Statement" ?
Hi All.
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
from emp
where deptno = 30)
values (7999,'Kash','MYJOB',7698,'16-SEP-2003',2100,0,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 ?
Thanks ...
Miki.
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.
Thanks, Miki.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|