Insert multiple rows with one sql statement in access

Hi,
I'm trying to copy a table into another. What I want to do is to use "Insert into table1 select * from table2 where field > val". Something like that. I know a lot of databases support it. I was wondering if ms access ODBC driver also supports it. I searched quite a bit and haven't found a definitive answer on this.
Thank you

Yes, M$ Access 2000 supports it. This is from their help:
INSERT INTO Statement
Adds a record or multiple records to a table. This is referred to as an append query.
Syntax
Multiple-record append query:
INSERT INTO target [(field1[, field2[, ...]])] [IN externaldatabase]
SELECT [source.]field1[, field2[, ...]
FROM tableexpression
Single-record append query:
INSERT INTO target [(field1[, field2[, ...]])]
VALUES (value1[, value2[, ...])
The way you've written the INSERT, table1 and table2 have to have the same # of columns and the same types, of course.

Similar Messages

  • Script error - Inserting multiple rows in one SQL statement.

    Hi,
    Tried using INSERT ALL INTO command inside Script. But getting below error.
    Oracle <> error message for operation <OCIStmExecute>: <ORA-00928: missing SELECT keyword>.
    Same query with single insert statement runs fine without any issues.
    Oracle eg:
    INSERT ALL
        INTO item (title) VALUES ('title5')
        INTO item (title) VALUES ('title6')
        INTO item (title) VALUES ('title7')
    SELECT * FROM dual;
    Appreciate your suggestions.
    Thx

    Hi,
    Actual syntax is as below:
    INSERT ALL
      INTO suppliers (supplier_id, supplier_name) VALUES (1000, 'IBM')
      INTO suppliers (supplier_id, supplier_name) VALUES (2000, 'Microsoft')
      INTO suppliers (supplier_id, supplier_name) VALUES (3000, 'Google')
    SELECT * FROM dual;
    Now in your non working query, you have applied comma after first INTO statement.
    Please remove it.
    Thanks,
    Swapnil

  • Select or deselect multiple rows with one single selection  event

    Does anyone know how to create a JTable which can select or deselect multiple rows with one single selection event in JTable. Fore example, if the table has
    row1
    row2
    row3
    row4
    row5
    row6
    What I need is when user select row1 or row2, both row1 and row2 should be set to be selected. Then if user press CTRL and click one of row3 or row4, both of them should be selected including the previouse selected row1 and row2.
    For deselection, if row1 and row2 are selected, when users deselect one of row1 or row2, both of them should be deselected.
    Hopefully someone can give me a hint.

    Here is a partial solution using a JList. Only one line gets highlighted when the user makes a selection in the list. But, two lines are returned. There is a blank line between every two lines.
         private void addLineToList() {
              String a = f_one.getText();
              String b = f_two.getText();
              if (a.length() == 0) {
                   Utils.showInformationMessage("Item field is empty.");
                   f_one.requestFocusInWindow();
                   return;
              if (b.length() == 0) {
                   Utils.showInformationMessage("Match field is empty.");
                   f_two.requestFocusInWindow();
                   return;
              model.addElement("item: " + a);
              model.addElement("match: " + b);
              model.addElement(" ");
              int size = model.getSize();
              pairList.setSelectedIndex(size - 3);
              f_one.setText("");
              f_two.setText("");
              f_one.requestFocusInWindow();
         private void editList() {
              if (pairList.getSelectedValue().toString().equalsIgnoreCase(" ")) {
                   Toolkit.getDefaultToolkit().beep();
                   f_one.requestFocusInWindow();
                   return;
              if (!f_one.getText().equals("")) {
                   int result = JOptionPane.showConfirmDialog(this,
                   "The Item field contains text. Replace the text?",
                   "Flash Card Activity", JOptionPane.YES_NO_OPTION,
                   OptionPane.INFORMATION_MESSAGE);
                   if (result == JOptionPane.NO_OPTION) return;
              if (!f_two.getText().equals("")) {
                   int result = JOptionPane.showConfirmDialog(this,
                   "The Match field contains text. Replace the text?",
                   "Flash Card Activity", JOptionPane.YES_NO_OPTION,
                   JOptionPane.INFORMATION_MESSAGE);
                   if (result == JOptionPane.NO_OPTION) return;
              String item = "";
              String match = "";
              int index = pairList.getSelectedIndex();
              String choice = model.getElementAt(index).toString();
              if (choice.startsWith("item")) {
                   item = choice;
                   match = model.getElementAt(index + 1).toString();
                   model.remove(index);
                   model.remove(index);
                   model.remove(index);
              else {
                   item = model.getElementAt(index - 1).toString();
                   match = choice;
                   model.remove(index + 1);
                   model.remove(index);
                   model.remove(index - 1);
              int size = model.getSize();
              if (size > 2) {
                   pairList.setSelectedIndex(size - 2);
              f_one.setText(item.substring(6));
              f_two.setText(match.substring(7));
              f_one.requestFocusInWindow();
         }

  • Inserting multiple rows with single insert statement ?

    Hi ,,
    Consider a PL/SQL procedure.
    I want to pass an array of values and insert in a table with a single statement.
    Moreover I want to call this procedure to insert multiple rows from OCI program.
    Can some body help ? :(
    Thanks
    Chandu

    Hi Vincent,
    Regular array insert which you have mentioned works in case of insert statement(This is to eliminate multiple calls to server)
    Will it work for passing array to Stored procedure, in this case procedure will be called only once with an array.
    It will be of great help if you give an example.
    Thanks
    Chandra

  • How to insert 22.5K rows in one sql statement in Oracle

    Hi Gurus,
    I have a one table with one column. I require to input 22.5k numbers example "08323459" in that table. Can anyone tell me how to insert those 22.5K numbers with one sql command.
    I am using PL/SQL client. And oracle version is 11G.

    If you have an Excel file, the simplest approach is generally to save the file as a CSV, copy it to the database server, create an external table that exposes the file as a table, and then write your INSERT by selecting the data from the external table.
    INSERT INTO permanent_table( column_name )
      SELECT column_name
        FROM external_tableAssuming you have SQL*Loader installed on your client machine, you could also use SQL*Loader to read the data in the file and load it into the database table.
    Justin

  • Insert multiple rows with autoincrement id

    I need to insert multiple rows to a table which has an autoincrement PK (unique), e.g:
    Entity:
    public Class Entity{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    Private Long id;
    Facade:
    @PersistenceContext(unitName = "xx-enterprise-ejbPU")
    protected EntityManager em;
    public void create(Entity entity) {
    em.persist(entity);
    Service Class:
    public Class Service implements ServiceLocal{
    @EJB
    private XxxFacadeLocal xxxFacade;
    public void saveEntity(Entity entity){
    xxxFacade.create(entity)
    ManageBean:
    public Class ManageBean
    @EJB
    private ServiceLocal service;
    public void doSave(ActionEvent event)
    service.saveEntity(entity1); //entity.id is set to null, suppose to be generated by DB auto_increment, i.e. insert 3 rows with 3 different ids
    service.saveEntity(entity2);
    service.saveEntity(entity3);
    The result is: Key duplication error on inserting entity2, but entity1 is inserted into DB with id auto increased correctly.
    If I insert only one row each time for test purpose, everything works as expected.
    But what I need is to insert multiple rows. How to do it?
    Thank you in advance.

    Like this (although the @Basic annotation is very much unnecessary). So if it isn't happening you must have made a mistake somewhere. Are you sure the ID column actually has auto_increment?
    Also if you are using Hibernate as the persistence provider and you put it on the classpath, check the packages of the annotations you are using; Hibernate and JPA share some with the same name unfortunately.

  • Table maint genertr inserting multiple rows with all fields editable

    Hi
    I have created a ztable in se11 and maintained table maintenance generator SM30.
    Now i need to insert multiple rows into the table with all fields editable.
    How can i achieve this?
    Thanks in advance.

    >
    deepak thimmegowda wrote:
    > Hi
    >
    > I have created a ztable in se11 and maintained table maintenance generator SM30.
    >
    > Now i need to insert multiple rows into the table with all fields editable.
    >
    > How can i achieve this?
    >
    > Thanks in advance.
    Create a Table maintenance generator with One Step .
    regards,
    Jinson.

  • Insert multiple line with one call to a SQL procedure

    Hello,
    I'm working with BC4J and UIX/XML.
    Our purpose is to insert in a table more then one row at one time and put them (all the rows) in an array.
    Then, we have to save them at one time by calling one time the function doDML().
    Thanks.

    Hello,
    I'm working with BC4J and UIX/XML.
    Our purpose is to insert in a table more then one row at one time and put them (all the rows) in an array.
    Then, we have to save them at one time by calling one time the function doDML().You may use BatchUpdating feature in Bc4J to achieve this.
    The semantics for using this for an Entity is same as the normal - non-batch mode. However by adding a batch-threshold on the Entity defnition (Entity Object Editor/Tuning panel), you can control if that entity type has a given number of affected rows, then framework should use batchmode post operations).
    When this is turned on, one roundtrip from entity DML will contain all entities of that type for that operation,for example if you have inserts/deletes/updates for Dept, then in one roundtrip, all deletes will go followed by another roundtrip for inserts and another one for updates.

  • Inserting multiple rows on one "Add Button"!

    I have an appliation that tracks family members (address book type app).
    form page that tracks "family relationships"
    (http://apex.oracle.com/pls/otn/f?p=55283:2)
    Page 2/3 are Master Details, where the detail reports are "relationships"
    From page three, if I select "Create" it takes me to the Form page
    (http://apex.oracle.com/pls/otn/f?p=55283:4) where I can create a relationship and hit "create" and the new record is now visible on page 3.
    What I'm trying to do, is create the inverse tie record at the same time. For example.
    If I say
    record 1 is related to record 2 as "value 3"
    I then want to at the same time, create an inverse record:
    record 2 is related to record 1 as "value 4".
    After researching the forum, I put my best effort into creating a button on page 4 called "Add New" (Thanks Andy for the idea!!) and a page process to run when this button is selected.
    There is a PK for the table in questions, that uses a sequence. I'm just learning SQL AND APEX, so I may have totally missed the boat...either way, this errors out on my instance i have on a closed network.
    (Unfortunately, my local firewall is not allowing me to post my SQL for the
    Here's my page process that fails:
    -- Take values from the three page items to create the first row:
    INSERT INTO FAMILY_ASSOC
    (FAMILY_ASSOC_ID, FAMILY_ID_1, FAMILY_ASSOC, FAMILY_ID_2) VALUES (
    FAMILY_ASSOC_SEQ.nextval,
    P4_FAMILY_ID_1,
    P4_FAMILY_ASSOC,
    P4_FAMILY_ID_2)
    -- Now reverse the ID_1 and ID_2 to create the Inverse record
    -- For example if the row input above is "X" is child of "Y"
    -- Need to create record "Y" is parent of "X"
    UNION (
    FAMILY_ASSOC_SEQ.nextval,
    P4_FAMILY_ID_1,
    DECODE(P4_FAMILY_ASSOC,
    '1','1',
    '2','2',
    '3','4',
    '4','3',
    '5','5',
    '6','6',
    '7','8',
    '8','7',
    '9','10',
    '10','9'),
    P4_FAMILY_ID_2)
    I've included some reports on page 4 to show what the table looks like:
    One report shows all the associations for the individual, and replaces the values with lookup values.
    The next report is exactly the same, but without the lookups.
    The last report is the same thing, but shows the inverse relationships for the same individual.
    Appreciate any ideas!!!

    Heck! And there was me trying to keep things simple :D
    In order for the reports to show data before it is written into the actual records, you would need to have a staging table or, at least, store the values on the page in session BEFORE the insert process runs. To do that, you would have to have a two-step process - one to create the temporary data or store the values and the second to actually write the records. The SQL statements that underlie the reports can easily be updated to refer to either the staging table or the session values. Of course, you would have to create at least one additional button on the page - to create/store the data temporarily - this would have to be conditional - and, the existing button would also have to be conditional, so that only one of the two buttons is displayed at any one time.
    Andy

  • Insert multiple rows in one step

    please i need to create an input form where i can insert more than one row at one step using jsp/struts/bc4j,i noticed that this is a repeated question on the form but no one answer

    If you are using JSF then you can use an ADF Faces multi row edit table.
    In 10.1.2 with JSP and Struts there was this how-to that might help:
    http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html

  • Update Multiple DataAdapters with one Sql Transaction

    hello, am trying to implement a save routine , common scenario master detail data . However after the first save succeed the second time the save fails with the common message.
    Concurrency Violation The Update affect....  
    I have the following function Save
    Private Function _Save() As Boolean
    _Save = False
    Dim con As New SqlClient.SqlConnection(connectionString)
    con.Open()
    Dim Tran As SqlClient.SqlTransaction = con.BeginTransaction
    Try
    MasterTA.InsertCommand = Masterbuilder.GetInsertCommand
    MasterTA.UpdateCommand = Masterbuilder.GetUpdateCommand
    MasterTA.DeleteCommand = Masterbuilder.GetDeleteCommand
    MasterTA.InsertCommand.Transaction = Tran
    MasterTA.DeleteCommand.Transaction = Tran
    MasterTA.UpdateCommand.Transaction = Tran
    MasterTA.InsertCommand.Connection = con
    MasterTA.DeleteCommand.Connection = con
    MasterTA.UpdateCommand.Connection = con
    DetailsTA.InsertCommand = DetailsBuilder.GetInsertCommand
    DetailsTA.UpdateCommand = DetailsBuilder.GetUpdateCommand
    DetailsTA.DeleteCommand = DetailsBuilder.GetDeleteCommand
    DetailsTA.InsertCommand.Transaction = Tran
    DetailsTA.UpdateCommand.Transaction = Tran
    DetailsTA.DeleteCommand.Transaction = Tran
    DetailsTA.InsertCommand.Connection = con
    DetailsTA.UpdateCommand.Connection = con
    DetailsTA.DeleteCommand.Connection = con
    MasterTA.Update(DS.Tables(0))
    DetailsTA.Update(DS.Tables(1))
    UpdateLedger(Tran)
    Tran.Commit()
    Return True
    Catch ex As Exception
    Tran.Rollback()
    MessageBox.Show(ex.Message, My.Application.Info.Title, MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
    Finally
    con = Nothing
    Tran = Nothing
    End Try
    End Function
    I am using a CommandBuilder
    if the Adpater 1 pass and the adapter 2 fail , I need to Re Fill my adapters again in order to avoid the concurrency violation . I CANNOT refill because I already have changes in the  DataTables I don't want the user to loose their information
    and start writing them again.
     The FULL procedure is successfully executed if no Exception occur with in the try catch
    I was able to eliminate the concurrency violation by  setting the
    commandBuilder.ConfilctOption=ConflictOption.OverwriteChanges but this will fail to update the correct changes the 2nd time to the database
    the only possible solution that I come  close to it. Before attempt to save anything
    Is to copy the datatables
    After update Fail Or Not
    Clear the DataTables from the Dataset
    Merge The dataTables from the DataSet with the Previous Copy Tables
    Exception Occure (Violation of primary key constraint '.....' attempt to insert a duplicate key)
    My IDS are not Auto Increment .
    I Really really need to use a transaction with DataAdapters ,
    I Also try the System.Transactions.TransactionScope
    but I have 2 problems
    Sometimes raise an error from the Server
    It doesn't work always as it behaves almost the same as I describe the problems above (Works only The first time)
    stelios ----------

    this the StackTrace when the error is ExecuteReader requires the command to have....
     at System.Data.Common.DbDataAdapter.UpdatingRowStatusErrors(RowUpdatingEventArgs rowUpdatedEvent, DataRow dataRow)
       at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
    And this is the StackTrace for the error Concurrency Violation
       at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
    stelios ----------

  • Inserting multiple rows with 1 value of sequence

    hi
    need help again for my same school project
    i need to insert the very 1 same value of a value which i get from a sequence/autocount(think of the situation like a point-of-sales where there is only 1 transaction no. for multiple items and not 1 for every single item sold)
    eg. nextval generated by sequence is 2
    transaction_no---item
    2----------------01
    2----------------02
    2----------------03
    and so on
    i know i can't do it by seq_name.nextval because it will increment by 1 which i stated to increment by in d sequence
    thank you!!!

    you may try this:
    First -- select seq_name.nextval from dual
    Save it into some variable and the use in your inserts

  • Insert multiple records with php

    please help me
    I have a problem in a multiple input records
    please help ...............
    example script:
    <?php require_once('Connections/koneksi.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO mhs (NIM, NAMAMHS, ALAMAT) VALUES (%s, %s, %s)",
                           GetSQLValueString($_POST['NIM'], "text"),
                           GetSQLValueString($_POST['NAMAMHS'], "text"),
                           GetSQLValueString($_POST['ALAMAT'], "text"));
      mysql_select_db($database_koneksi, $koneksi);
      $Result1 = mysql_query($insertSQL, $koneksi) or die(mysql_error());
      $insertGoTo = "baru.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    mysql_select_db($database_koneksi, $koneksi);
    $query_Recordset1 = "SELECT * FROM mhs";
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $koneksi) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <p> </p>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
      <table border="1">
        <tr>
          <td>NIM</td>
          <td>NAMAMHS</td>
          <td>ALAMAT</td>
          <td> </td>
        </tr>
        <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['NIM']; ?></td>
          <td><?php echo $row_Recordset1['NAMAMHS']; ?></td>
          <td><?php echo $row_Recordset1['ALAMAT']; ?></td>
          <td><table align="center">
            <tr valign="baseline">
              <td nowrap="nowrap" align="right">NIM:</td>
              <td><input type="text" name="NIM" value="" size="32" /></td>
            </tr>
            <tr valign="baseline">
              <td nowrap="nowrap" align="right">NAMAMHS:</td>
              <td><input type="text" name="NAMAMHS" value="<?php echo $row_Recordset1['NAMAMHS']; ?>" size="32" /></td>
            </tr>
            <tr valign="baseline">
              <td nowrap="nowrap" align="right">ALAMAT:</td>
              <td><input type="text" name="ALAMAT" value="<?php echo $row_Recordset1['ALAMAT']; ?>" size="32" /></td>
            </tr>
            <tr valign="baseline">
              <td nowrap="nowrap" align="right"> </td>
              <td> </td>
            </tr>
          </table></td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
      <input type="submit" value="Insert record" />
    </form>
    <p> </p>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

    PowerMilk wrote:
     I want to update multiple rows with one click on the submit button.Unfortunately, it doesn't work. What is wrong in the code?
    It would be more helpful if you were to say what happens. "It doesn't work" isn't very helpful.
    However, a quick look at your code reveals that your hidden field that contains the ID is outside the loop (repeat region) in your form. Move it inside the loop like this:
    <?php do { ?>
    <tr>
       <td><input name="dag[]" type="text" value="<?php
    echo $row_rsWijzigOpeningsuren['dag']; ?>" size="15" maxlength="15"
    /></td>
       <td><input name="voormiddag[]" type="text" value="<?php echo
    $row_rsWijzigOpeningsuren['voormiddag']; ?>" size="15" maxlength="15"
    /></td>
       <td><input name="namiddag[]" type="text" value="<?php echo
    $row_rsWijzigOpeningsuren['namiddag']; ?>" size="15" maxlength="15"
    /></td>
    </tr>
    <input name="id[]" type="hidden" value="<?php echo $row_rsWijzigOpeningsuren['id']; ?>" />
    <?php } while ($row_rsWijzigOpeningsuren = mysql_fetch_assoc($rsWijzigOpeningsuren)); ?>

  • How to insert multiple rows in a single insert statement in MaxDB?

    hi,
    I was looking at syntax but i could not get it right.. may be some could help me.
    // Insert single row works fine
    INSET INTO test_table(column_name) values (value1) IGNORE DUPLICATES
    // Insert multiple rows, doesn't
    INSET INTO test_table(column_name) values (value1), (value2), (value3) IGNORE DUPLICATES
    Can somebody help me with this.
    thanks,
    sudhir.

    Multiple inserts do only work with parametrized statements, usually used in interfaces like JDBC, ODBC etc.
    With static SQL statements it is not possible.
    Regards Thomas

  • Inserting multiple rows using a single Insert statement without using dual

    Hi all,
    i am trying to insert multiple rows using a single insert statement like the below one.
    The below one works fine..
    But is there any other change that can be done in the below one without using dual...
    insert all
    into ps_hd_samp (num1,num2) values (1,1)
    into ps_hd_samp (num1,num2) values (2,2)
    into ps_hd_samp (num1,num2) values (3,3)
    select 1 from dual;

    NiranjanSe wrote:
    Hi all,
    i am trying to insert multiple rows using a single insert statement like the below one.
    The below one works fine..
    But is there any other change that can be done in the below one without using dual...
    insert all
    into ps_hd_samp (num1,num2) values (1,1)
    into ps_hd_samp (num1,num2) values (2,2)
    into ps_hd_samp (num1,num2) values (3,3)
    select 1 from dual;
    SQL> create table ps_hd_samp (num1 number,num2 number);
    Table created.
    SQL> insert all
      2  into ps_hd_samp (num1,num2) values (1,1)
      3  into ps_hd_samp (num1,num2) values (2,2)
      4  into ps_hd_samp (num1,num2) values (3,3)
      5  select count(*)
      6  from ps_hd_samp;
    3 rows created.
    SQL> select * from ps_hd_samp;
          NUM1       NUM2
             1          1
             2          2
             3          3

Maybe you are looking for

  • A tricky question: how to automatically product a HTML version report?

    Greetings: I have to tackle with an issue in one of our Apex apps: send a report to users in HTML format at every night. The rationale behind this is that, the report takes fairly long time to be generated. We don't wanna the user go to the app and w

  • External's for Editing

    Hey, Just a quick one. What would be the best type of external drive or connection from external to mac be if I wanted to edit with material directly off the external? Firewire would be acceptable for lower file siezes, but what would be the best for

  • Rating albums?

    Why hasn't iTunes have this feature? You can rate individual songs and such, and they just implemented album reviews on the Music Store... but when will they give the user the ability to rate their music by album on top of just the individual songs.

  • How to set the default language for JRE?

    I appreciate the fact that JRE is intelligent enough to select language according to my system default codepage, which is 936 (Simplified Chinese). However, i don't find any option in java control panel or java.exe command line switch to change the c

  • Mailboxes how to remove bulk mails?

    The Mails screen on my IPhone5 and Ipad2 show that I have over 2100 mails. When I download I only get mails that were sent recently so the large number remains. This is what I see All mailboxes 2156 account 1     1570 account 2         12 account 3