DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Why using this kind of "Insert Statement" ?

  1. #1
    Join Date
    Sep 2003
    Posts
    7

    Question 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.

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    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.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Sep 2003
    Posts
    7
    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
  •  


Click Here to Expand Forum to Full Width