Register Login

How to Insert Data into Multiple Table Using One Single Query?

Updated May 19, 2018

Hi friends,
Can any one tell me how can we insert some data into Multiple Table Using ONE SINGLE QUERY. Its an Interview Question so please reply me If any one can solve this asap.

Thanks in Advance


Comments

  • 24 Aug 2015 6:28 pm Nitesh Singh

    One can do it using insert all command.

  • 24 Aug 2015 6:29 pm Abhijeet Mudgal

    One can do it by using the following command:
    INSERT ALL
    INTO suppliers (supplier_id, supplier_name) VALUES (1000, 'IBM')
    INTO suppliers (supplier_id, supplier_name) VALUES (2000, 'Microsoft')
    INTO customers (customer_id, customer_name, city) VALUES (999999, 'Anderson Construction', 'New York')
    SELECT * FROM dual;


×