Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7800911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:47:18+00:00 2026-06-02T00:47:18+00:00

I am using an INSERT ALL statement in Oracle to insert data into two

  • 0

I am using an INSERT ALL statement in Oracle to insert data into two different tables. The data is coming from a rather complex subquery rather than a VALUES clause.

My issue is that I don’t want to insert all the columns returned by the subquery into both tables.

As a simple example, suppose I have two tables tab1 and tab2 each containing three columns col1, col2 and col3.

Now suppose my subquery returns a single row with the values A, B and C.

So, I want A, B and C inserted into col1, col2 and col3 of tab1 respectively, but I want, say, only A and C to go into col1 and col3 of tab2.

My statement would look something like this:

INSERT ALL
INTO tab1
  (col1, col2, col3)
INTO tab2
  (col1, ?, col3)
FROM
( ...
 complex subquery which returns A, B, C
  ...
)

Is there a way I can use some sort of a ‘filler’ or ‘garbage column’ to allow me to achieve my objective?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:47:20+00:00Added an answer on June 2, 2026 at 12:47 am

    Yes:

    INSERT ALL
    INTO tab1
      (col1, col2, col3) values (a, b, c)
    INTO tab2
      (col1, col3) values (a, c)
    SELECT a, b, c
    FROM
    ( ...
     complex subquery which returns A, B, C
      ...
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using INSERT INTO to copy rows of data from one table to another:
I am using QSqlQuery to insert data into a MySQL database. Currently all I
Using VB.Net I want to get a all datagrid cell values, then insert into
I'm using Codeigniter to insert some data into a MySQL table. However, the single
Kindly give me some example that how we can use INSERT INTO ALL STATEMENT
In SQL Server there is the ability to INSERT all of the data from
I'm trying to insert some Binary data into a MySQL database without using prepared
I am using simple insert statement to insert value to CLOB varaible, anyway i
So I'm trying to do a simple insert using Linq but i'm running into
I am using Hibernate to insert a row into a database, I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.