Difference between Insert and Insert all

Hi,
I tried to understand what INSERT ALL syntax is doing, but I cannot find any difference between INSERT and INSERT ALL.
I replicated the test scenario using the data from the below mentioned URL:
http://psoug.org/reference/insert.html
I also did a google on finding up the difference between them, but could not find any...
Please advice if both are same as I have planned to use INSERT statement with a WHEN clause if INSERT ALL is same as INSERT.
Thanks!

Hello
The key difference is that INSERT ALL will allow you to insert into multiple different tables in a single statement whereas INSERT will only insert into 1 table. Each of the WHEN clauses allows a different table to be specified.
SQL> create table t1
  2  (   id  number
  3  )
  4  /
Table created.
Elapsed: 00:00:00.01
SQL> create table t2
  2  (   id  number
  3  )
  4  /
Table created.
Elapsed: 00:00:00.00
SQL> create table t3
  2  (   id  number
  3  )
  4  /
Table created.
SQL> INSERT
  2  ALL
  3      WHEN id < 10 THEN
  4          INTO t1 VALUES(id)
  5      WHEN MOD(id,2) = 0 THEN
  6          INTO t2 VALUES(id)
  7      WHEN MOD(id,2) != 0 THEN
  8          INTO t3 VALUES(id)
  9  SELECT
10      rownum id
11  FROM
12      dual
13  CONNECT BY
14      LEVEL <=20
15  /
29 rows created.
Elapsed: 00:00:00.01
SQL> select * from t1;
        ID
         1
         2
         3
         4
         5
         6
         7
         8
         9
9 rows selected.
Elapsed: 00:00:00.01
SQL> select * from t2;
        ID
         2
         4
         6
         8
        10
        12
        14
        16
        18
        20
10 rows selected.
Elapsed: 00:00:00.00
SQL> select * from t3
  2  /
        ID
         1
         3
         5
         7
         9
        11
        13
        15
        17
        19
10 rows selected.
Elapsed: 00:00:00.01So you can see that in a single statement, I've inserted all rows with an ID <10 into t1, all even numbered rows into t2 and all odd numbered rows into t3. This was also done with a single pass of the source table - in this case dual.
David

Similar Messages

  • What's the difference between shuffle and shuffle all?

    What's the difference between shuffle and shuffle all?

    Thanks but I have no playlists.  Perhaps you know then how the buttons work:
    ie. when "shuffle" is showing, does that mean it set to "shuffle all" and vice versa?
    the logic on these Iphones is whacky...
    Thanks!

  • Difference between "restore" and "erase all content and settings"?

    Hello,
    I was wondering what is the difference between "Restore" on itunes and "Erase all content and settings" on iphone?
    Is it the same and if yes why does it take longer to "Erase all content and settings" on iphone?

    The restore only deletes all the data and reinstalls the iPhone Operating System, but someone can still carve out deleted information if they know what they are doing. The erase all content and settings will delete and overwrite everything on the iPhone so it is impossible to even extract any data from the iPhone.
    Personally I've only used the erase all content and settings when I've had to return my iPhone to Apple for technical difficulties or when I've sold an iPhone to someone else. There is no reason to do this method if you are simply reinstalling the Operating System for yourself.

  • What exactly is the difference between :"Refresh" and "Expand All"?

    They seem to do the same thing most of the time. What is the difference?

    Hi Dermot,
    Well, for a report that uses no expansions the time it takes for Refresh and Expand All should be about the same. Maybe a little bit faster for Refresh. But if your report does have expansions, Refresh should be significantly faster.
    Here is the list of what happens to each EVDRE in your workbook when you click the "Expand All" button: [http://help.sap.com/saphelp_bpc75_nw/helpdata/en/fb/b03d0099e8428d95eb7de2c964cf18/frameset.htm] It has 8 steps. I believe that when you click the "Refresh" button it only executes steps 3 and 4 (not completely sure about that, but you get the point - it doesn't do everything).
    Expand All can get especially problematic when you have a workbook with a large number of EVDREs. In this case, a nice option  is to right-click on the worksheet and take a look at the options under the top menu item. One of the options is to expand only the active sheet, which can save you a lot of time.
    Cheers,
    Ethan

  • What is the difference between retore and erase all content and settings

    i was wondering what is the difference an ordinary retore in itunes and a erase all content and setting on my ipod touch. do they both do the same thing because i might sell my ipod and also does this process require you to connect to itunes after or can you just give it to the new user.

    Erase all settings restores the device to its original factory state. All your stuff is gone and there is no iOS installed.
    iTunes Restore simply replaces the device content with that from your last backup. It does not change the version of nor install a version of iOS. Whateve version of iOS is on the device remains.
    Restore is used if you are having a problem with something on your device. Erase all Settings is used to remove everything in the event you were selling the device and wanted to clear it of all your files and data.
    See the IPod Touch user guide

  • Diference between Consolidate and consolidate all with data

    I would like to get clarified on the differences between "Consolidate" and "Consolidate All" option in HFM while performing a consolidation.

    Consolidate finds only the part of the data that is impacted by changes and performs all calculation, translation and consolidation rules for only that part of data.
    Consolidate All on the other hand calculates everything even if there are no underlying changes
    Consolidate All With Data performs as the Consolidate All it skips entities that have no data inputted though

  • In jdbc adapter what is the difference between insert and update insert

    in jdbc adapter what is the difference between insert and update insert
    Edited by: katru vijay on Mar 22, 2010 7:43 AM

    Please refer to this Link [Document Formats for the Receiver JDBC Adapter|http://help.sap.com/saphelp_nw04/Helpdata/EN/22/b4d13b633f7748b4d34f3191529946/frameset.htm]
    Hope this helps.
    Regards,
    Chandravadan

  • What si the difference between crete and create insert operations.

    Hi
    In ADF 11g,what is the difference between create and createinsert operations.
    if anyone knows plz tell me.Any document about this plz provide me.
    Any help is appreciated.
    Sailaja.

    Hi,
    CreateInsert: Creates a new row that becomes the current row, and inserts the
    new blank row into the data source.
    Create: Creates a new row that becomes the current row, but does not insert it.
    --> normaly you would use createinsert
    Doc you can find here (search for Createinsert): http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974.pdf
    br
    Peter

  • Whats the Difference between Wrapping and Inserting a subform?

    Pardon me for asking what is probably a silly question. But what is the difference between wrapping and inserting a subform? Thank you very much in advance.

    -When you insert a subform, a new subform that does not contain any form objects at the time of creation is added.
    -When you have existing form objects that you decide at a later time in your designing process to be contained in a subform, you can wrap these existing form objects by a subform.

  • Difference between MERGE and Update/Insert

    Can anybody pls tell me what is the difference between MERGE and Update/Insert statements.

    hi vivek,
    merge is totally different than normal update and insert.Merge is a combination of update+inserrt.
    Merge statment first checks the data in your table, if data is already exists then it will try to update the data otherwise it will go for insertion.In case of normal update/insert it will not check the data directly it does the specified operation.
    So based on your requirement you have to select the best option.
    Thanks.

  • Hi All difference between abap and hr-abap urgent pls

    Hi All difference between abap and hr-abap urgent pls

    Hello,
    To add to the above points regarding infotypes
    Infotypes stand apart in  HR and manage a volume of data in HR domain..they are unique to HR module ranging from basic employee information to time management and finally the custom infotypes.....
    Payroll and other monetory activities related to an employee also form a vital part of the HR module....
    while considering Reports..in HR data is mainly with respect to infotypes and the concept of PAKEY...7 key fields which uniquely defines any record in an infotype is used..with Pernr(employee number),Begda(begindate) and Endda(enddate) form an integral part of the key..Based on the time constraints(1,2,3) of an infotype the keys are judged (to retrieve data from an infotype)
    In ABAP HR we also have lots of predefined function modules that can be used..eg:go to se37..put 'HR*' and press F4...
    finally to update an HR infotype record we use the function module hr operation rather than direct updates...also there are standard audit trail reports that monitors various activities such as insert/modify/delete operations on an hr infotype record...
    Pls revert back for clarity and reward if helpful
    Regards
    Byju

  • What is difference between modify and update i am using

    hi
    what is difference between mofify and update
    my requiremen is to have three condition checkec while mofifying or updating from a internal table
    the three fields are
    cus no
    status
    date these all are primary key in the database table
    so which sould i use modify or update
    there might be entry already existing in database table or new entry to be created if already existin it should check on the primary keys and updatat if not it should add a record
    pls suggest whihc to use and how to implement the check on teh threee primary key
    like if modify ztable from table it_test
    now where condition ? can be used or not with modify? and if yes how
    if not should i use update will update create a new entry if no entry is there and please give syntex
    regards
    Arora

    Hi Nishant Arora,
    Modify: It works in performing two actions.
    They are: Insert + Update.
    For Example If a record that is exited in database, so you are modifying that record, it updates that particular record.
    Similarly, If the is not existed in the database, you are modifying it, it inserts a new record.
    Update: Update means just it updates the status, I mean it only updates the record. It doesn't inserts any new record if that particular record is not present in the database.
    These are the cases you need to write these statements.
    Syntaxes: :
    Go through this links please.,
    http://help.sap.com/saphelp_nw04/helpdata/en/e7/968aa8b2384dd9835f91e7f8470064/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm
    Reward points if useful
    Cheers,
    Swamy Kunche
    Edited by: Swamy Kunche on Jun 11, 2008 2:41 PM

  • Difference between CHAR and VARCHAR2 datatype

    Difference between CHAR and VARCHAR2 datatype
    CHAR datatype
    If you have an employee name column with size 10; ename CHAR(10) and If a column value 'JOHN' is inserted, 6 empty spaces will be inserted to the right of the value. If this was a VARCHAR column; ename VARCHAR2(10). How would it handle the column value 'JOHN' ?

    The CHAR datatype stores fixed-length character strings, and Oracle compares CHAR values using blank-padded comparison semantics.
    Where as the VARCHAR2 datatype stores variable-length character strings, and Oracle compares VARCHAR2 values using nonpadded comparison semantics.
    This is important when comparing or joining on the columns having these datatypes;
    SQL*Plus: Release 10.2.0.1.0 - Production on Pzt Au 6 09:16:45 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> conn hr/hr
    Connected.
    SQL> set serveroutput on
    SQL> DECLARE
    2 last_name1 VARCHAR2(10) := 'TONGUC';
    3 last_name2 CHAR(10) := 'TONGUC';
    4 BEGIN
    5 IF last_name1 = last_name2 THEN
    6 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is equal to -' || last_name2
    || '-');
    7 ELSE
    8 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is NOT equal to -' || last_n
    ame2 || '-');
    9 END IF;
    10 END;
    11 /
    -TONGUC- is NOT equal to -TONGUC -
    PL/SQL procedure successfully completed.
    SQL> DECLARE
    2 last_name1 CHAR(6) := 'TONGUC';
    3 last_name2 CHAR(10) := 'TONGUC';
    4 BEGIN
    5 IF last_name1 = last_name2 THEN
    6 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is equal to -' || last_name2
    || '-');
    7 ELSE
    8 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is NOT equal to -' || last_n
    ame2 || '-');
    9 END IF;
    10 END;
    11 /
    -TONGUC- is equal to -TONGUC -
    PL/SQL procedure successfully completed.
    Also you may want to read related asktom thread - "Char Vs Varchar" http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1542606219593
    and http://tahitiviews.blogspot.com/2007/05/less-is-more-more-or-less.html
    Best regards.

  • Differences between LSMW and BDC

    Hi All
    Please can you give me the few points about the differences between LSMW and BDC?
    Awaiting for your Responce
    Praveen

    Hai Check with the following document
    GOOD
    THERE IS THREE TYPE OF METHOD IN BDC
    BDC SESSION
    CALL TRANSACTION
    CALL DIALOG
    What is BDC or batch input
    The Batch Input is a SAP technic that allows automating the input in transactions. It lies on a BDC (Batch Data Commands) scenario.
    BDC functions:
    · BDC_OPEN_GROUP : Opens a session group
    · BDC_CLOSE_GROUP : Closes a session
    · BDC_INSERT : Insert a BDC scenario in the session
    · The ABAP statement "CALL TRANSACTION" is also called to run directly a transaction from its BDC table.
    It runs the program RSBDCSUB in order to launch automatically the session. The session management is done through the transaction code SM35.
    The object itself is maintanable through the transaction SE24.
    BDC methods:
    Method
    Description
    Parameters
    OPEN_SESSION
    Opens a session
    SUBRC (Return Code – 0 OK)
    SESSIONNAME (Session to be created)
    CLOSE_SESSION
    Closes a session
    None
    RESET_BDCDATA
    Resets the BDC Internal Table...
    None. Normally, for internal purpose…
    BDC_DYNPRO
    Handles a new screen
    PROGNAME (Name of the program)
    DYNPRONR (Screen Number)
    BDC_FIELD
    Puts a value on the screen
    FIELDNAME (Name of the field)
    FIELDVALUE (Value to be passed)
    CONSTRUCTOR
    Constructor - Initializes NO_DATA
    NODATA (No data character). The constructor is called automatically when the object is created.
    RUN_SESSION
    Launches a session with RSBDCBTC
    None
    CALL_TRANSACTION
    Calls a transaction with the current BDC Data
    MODE (Display Mode)
    UPDATE (Update Mode)
    TCODE (Transaction to be called)
    BDC_INSERT
    Inserts the BDC scenario in the session
    TCODE (Transaction to be called)
    BDC techniques used in programs:
    1) Building a BDC table and calling a transaction,
    2) Building a session and a set of BDC scenarios and keeping the session available in SM35,
    3) Building a session and lauching the transaction right after closing the session.
    BDC using Call Transaction
    BDC using Call transaction involves calling an SAP transaction in back ground from within the ABAP
    program. The process involves building an Internal BDC table containing the screen information needed to
    execute the required transaction and then passing this to the Call transaction command (See code example).
    The full procedure for creating a BDC program is as follows:
    What is the difference between batch input and call transaction in BDC?
    Session method.
    1) synchronous processing.
    2) can tranfer large amount of data.
    3) processing is slower.
    4) error log is created
    5) data is not updated until session is processed.
    Call transaction.
    1) asynchronous processing
    2) can transfer small amount of data
    3) processing is faster.
    4) errors need to be handled explicitly
    5) data is updated automatically
    BATINPUT/DIRECT INPUT
    A: Batch-inputs can not be used to fill the "delivery due list" screen because it is not a dynpro. This is a standard SAP report. A SAP report (check with "System -> Status") may be called using SUBMIT sentence with the appropriate options . It is preferred to call a report than create a Batch-input program.
    GO THROUGH THIS LINK
    http://www.guidancetech.com/people/holland/sap/abap/zzsni001.htm
    The LSM Workbench is an SAP R/3 based tool that supports the one-time or periodic transfer of data from non-SAP systems ("legacy systems") to SAP systems.
    The LSM Workbench helps you to organize your data migration project and guides you through the process by using a clear sequence of steps.
    The most common conversion rules are predefined. Reusable conversion rules assure consistent data conversion for different data objects.
    LSMW vs DX Workbench
    The LSM Workbench covers the following steps:
    Read the legacy data from one or several files (e.g. spreadsheet tables, sequential files).
    Convert the data from source format to target format.
    Import the data using standard interfaces (Batch Input, Direct Input, BAPI, IDoc).
    Experiences made in successful implementation projects have shown that using the LSM Workbench significantly contributes to accelerating data migration.
    SAP provides this tool along with documentation to customers and partners free of charge.
    Users of the LSM Workbench receive the usual support via SAP Net - R/3 Frontend (component BC-SRV-DX-LSM).
    Releases:
    Version 1.7.2 of the LSM Workbench ("LSMW 1.7.2") available
    Attention : LSMW 1.7.2 requires an SAP R/3 system with SAP R/3 4.0 or SAP R/3 4.5.
    Version 1.8.0 of the LSM Workbench (1.21mb) ("LSMW 1.8.0") available
    Attention : LSMW 1.8.0 requires an SAP R/3 system with SAP R/3 4.6.
    Version 3.0 of the LSM Workbench (1.89mb) ("LSMW 3.0") available for Web Application Server 6.10
    Attention : LSMW 3.0 requires a SAP WAS 6.10. Functionality of version 1.7.2 and 3.0 are identical !
    Version 4.0 of the LSM Workbench ("LSMW 4.0") integrated in Web Application Server 6.20
    Attention : LSMW 4.0 is an integrated part of SAP WAS 6.20.
    Thanks & regards
    Sreenivasulu P
    Message was edited by: Sreenivasulu Ponnadi

  • What is the Differences between Caingorm2 and Parsley(Caingorm3) ? Very Urgent ...plz help me out..

    Hi all,
            I am familier with caingorm 2 , and i am new to parsley , can any one give  differences between caingorm2 and parsley(caingorm3) ?
    and also please
    1)how to create a BeanConfig.mxml configuration  file in parsly ? how many ways we can inject beans in BeanConfig.mxml
    2)and how the event dispatched in parsly and handled by parsley step-by step?
    3)please explain by taking a small example insert usename and password in to data base using LCDS ?
    thanks
    -Balu

    Hi
    You can refer the following links for your question.
    Difference between AET and EEWB
    What is the use of AET? What are the differences between AET and EEWB?
    Difference between EEWB - UI Configuration Tool - AET
    http://senthilsapcrm.wordpress.com/2010/02/04/adding-custom-fields-in-sap-crm-7-0-using-aet/
    What is the main difference between eewb and aet tool ?
    Hope it is useful.
    Thanks and regards
    Preeti Viswanath

Maybe you are looking for

  • I cannot sync notes between iPhone 4S and iPad 2. Both devices are running iOS 5.0.1.

    I am unable to sync notes between iPhone 4S and iPad 2. Both devices are running iOS 5.0.1. Any solution?

  • Canon 5d Mark II and Raw Images in CS4

    HI I have a Canon 5D Mark II and have just upgraded to standard CS4. When I go to view my Raw files on bridge I am unable to do this - all I see instaed of the thumbnail is the CR2 file. When I click on the file it states 'could not complete your req

  • ClassNotFoundException in applet-urgent

    Hai I am having an applet "tstapplet" whose class file is stored in a jar file and the applet is inside a package named test. I wrote the following applet tag <applet code="tstapplet.class" archive="../deploy/showj.jar"> </applet> I am getting ClassN

  • Working With Edge Animate and Business Catalyst

    Does anyone work with a site with incorporates Edge Animations that is hosted on Business Catalyst?  I am asking because my Edge animations run fine on my page on preview in browser but do not run at all when uploaded to BC.  Here is my script: Thank

  • Can my G3 handle OS X 10.4?

    Hi everyone, I'm a bit new with Macs, the OS, and the hardware. I'm a tech guy so don't be afraid to reply with technical info. What I need to know is if my G3 can handle 10.4 and if not what should I upgrade (i.e. speed and pin# for RAM would be app