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 7611457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:40:19+00:00 2026-05-31T01:40:19+00:00

I an trying to INSERT multiple rows into an SQL, Oracle table though SQL

  • 0

I an trying to INSERT multiple rows into an SQL, Oracle table though SQL Developer v3.0.04

the Database was set-up by Uni so I don’t know what version it is.

after looking on-line I have come up with the code below but it will not INSERT any data. I have tested the insert with just one row and that is OK. What am I missing?

Insert all 
  Into Patient Values
    ('101', '1 house', Null, 'Kingston', 'Surrey', 'KT1 1XX', '10/jan/1980', 'm', 01452987456)
  Into Patient Values
    ('102', '2 egg rd', 'vail', 'guildford', 'Surrey', 'GU1 1LL', '05/dec/1985', 'm', 01452987456)
  Into Patient Values
    ('103', '6 station rd', Null, 'guildford', 'Surrey', 'GU1 2XX', '15/may/1990', 'f', 01452987456)

Select * from Patient;
  • 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-05-31T01:40:20+00:00Added an answer on May 31, 2026 at 1:40 am

    INSERT ALL has two different uses. One is to insert different sub-sets of selected columns into a table. The other is to direct rows into different according to certain criteria. In both cases the data comes from a SELECT clause rather than from VALUES. See the examples in the documentation.

    Normally, you would simply write multiple INSERT statements potentially in a single PL/SQL block. Something like

    begin
      Insert Into Patient Values
        ('101', '1 house', Null, 'Kingston', 'Surrey', 'KT1 1XX', '10/jan/1980', 'm', 01452987456);
      Insert Into Patient Values
        ('102', '2 egg rd', 'vail', 'guildford', 'Surrey', 'GU1 1LL', '05/dec/1985', 'm', 01452987456);
      Insert Into Patient Values
        ('103', '6 station rd', Null, 'guildford', 'Surrey', 'GU1 2XX', '15/may/1990', 'f', 01452987456);
    end;
    /
    

    If you really want to do this in a single SQL statement, you can do an INSERT ... SELECT but that’s generally going to be more complex than using three separate statements.

    insert into patient
      select *
        from (select '101' id, '1 house' addr, null col1, 'Kingston' city, ...
                from dual
              union all
              select '102', '2 egg rd', 'vail', 'guildford', 'Surrey', 'GU1 1LL', '05/dec/1985', 'm', 01452987456
                from dual
              union all
              select '103', '6 station rd', Null, 'guildford', 'Surrey', 'GU1 2XX', '15/may/1990', 'f', 01452987456
                from dual)
    

    I would also caution you to use proper data types and to specify the column names in your INSERT statement. I’m guessing, for example, that the first column of Patient table is some sort of PatientID that is defined as a NUMBER. If so, you’d really want to insert a number rather than a character string. Similarly, the seventh column with values like ’15/may/1990′ is probably defined as a DATE in the table. If so, your INSERT should insert a DATE not a character string by either explicitly calling TO_DATE with a particular format mask or by using the ANSI date format, i.e. date '1980-01-10'. And if you want the last column to retain the leading 0, you’ll need to ensure that the column in the database is defined as a VARCHAR2 and that you insert a character string rather than a number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to insert 315K Gif files into an Oracle 10g database. Everytime I get
I'm trying to insert multiple rows using SqlCommand from C# to SQL Server. I'm
I'm trying to insert an HTML blob into our sql-server2005 database. I've been using
I am trying to insert multiple records into a table where each record has
I am trying to insert 2 rows into the same table. The first will
I am trying to insert multiple rows in a MySQL table from PHP arrays.
i am trying to insert some info into an sql server table but instead
I am trying to insert multiple rows into MySQL DB using PHP and HTML
i would like to know how to insert multiple rows in a single table,i
I am trying to INSERT INTO a table using the input from another table.

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.