Need a method to insert 1000 records in oracle in once

Hi All,
I want to insert more than 1000 records in oracle database in once. Please let me know the way to do this. It's urgent..........
Regards,
Puneet Pradhan

More then 1000?
So, how about 10000?
Use the CONNECT BY LEVEL clause to generate records:
insert into table
select level --or whatever
from dual
connect by level <= 10000;
It's urgent..........Since it's your first post, I recommend you to not use the 'U-word', or you'll be made fun of...

Similar Messages

  • Insert 1000 records per second

    I need to insert 1000 records in mysql database what is the best approach
    i will get the requests from a through a http url currently we are using http server to handle the incoming requests

    This thread was originally posted to the Java Database Connectivity (JDBC).
    It appears to be off-topic for that forum.
    It has been moved to a database sub-forum, hopefully for closer topic alignment.

  • Script for inserting 1000 record in a table...

    Hello Gurus,
    I have a table structure like this....
    USERID     USERNAME     USERPWD     EMAILID     FIRSTNAME     LASTNAME     ISACTIVE
    1     superuser     Pyramid123      [email protected] a b      1
    21     neha     Pyramid123     [email protected] s     s     1
    I need to write a script where i can insert 1000 dummy related records into this table..
    your help would be appreciated..
    Thanks,
    HP

    Hi,
    Hope the below solves your problem.
    SQL> CREATE TABLE t (USERID NUMBER,
      2                  USERNAME VARCHAR2(20),
      3                  USERPWD VARCHAR2(10),
      4                  EMAILID VARCHAR2(20),
      5                  FIRSTNAME VARCHAR2(10),
      6                  LASTNAME VARCHAR2(10),
      7                  ISACTIVE NUMBER);
    Table created
    SQL> INSERT INTO t
      2    SELECT srl,
      3           name,
      4           pwd,
      5           LOWER(SUBSTR(name, 1, 10)) || '@abc.com',
      6           SUBSTR(name, 1, 10),
      7           SUBSTR(name, 11, 20),
      8           1
      9      FROM (
    10    SELECT level srl,
    11           dbms_random.string('U', 20) name,
    12           dbms_random.string('A', 10) pwd
    13      FROM DUAL
    14   CONNECT BY LEVEL <= 1000);
    1000 rows inserted
    SQL> commit;
    Commit complete
    SQL> select count(1) from t;
      COUNT(1)
          1000
    SQL> select * from t where rownum < 10;
        USERID USERNAME             USERPWD    EMAILID              FIRSTNAME  LASTNAME     ISACTIVE
           342 JLMPNCRYRZYLEGVVKLQT ypsFEvtYOg [email protected]   JLMPNCRYRZ YLEGVVKLQT          1
           343 UINEJWHGFHCBOUXWQWEL OSBmpXSSDp [email protected]   UINEJWHGFH CBOUXWQWEL          1
           344 TLGFDHHLMACMMENWRMZG RIrPTdotaX [email protected]   TLGFDHHLMA CMMENWRMZG          1
           345 QARLMGJVFJXTJRQUFRFU lkbvEGACDi [email protected]   QARLMGJVFJ XTJRQUFRFU          1
           346 TYMDMPTWASFOGIYZYBZP SadCSlHiZc [email protected]   TYMDMPTWAS FOGIYZYBZP          1
           347 XDTRMJICNQNKFMDRRMZB lSchkFigpz [email protected]   XDTRMJICNQ NKFMDRRMZB          1
           348 DQZUKSXOLMQLMFBMEGNI psBCKgLVPP [email protected]   DQZUKSXOLM QLMFBMEGNI          1
           349 JMTNKXDDAPDHYLHUVSWF WXYrBQNKJk [email protected]   JMTNKXDDAP DHYLHUVSWF          1
           350 ZHAFZAJPJCBHNLTCQWTB rhtoGTpBle [email protected]   ZHAFZAJPJC BHNLTCQWTB          1
    9 rows selected
    Regards
    Ameya

  • Need session variable after inserting a record.

    I have a page where I am setting up a new user.  After they enter their username, password, address etc. I am inserting the record when they press the commit button, then moving on to the next page.
    I have a session variable setup called user_name, which is also the name of the field in my table.
    My problem is that the value in my session variable goes away after inserting the record.  How do I retrieve the value of user_name?
    At the top of my 2nd page I have:
    <?php
         session_start();
         $_SESSION['user_name'] = $_POST['user_name'];
    ?>
    This gives me an index error.
    I also have session_start(); at the top of my first page.
    What am I doing wrong?
    Thanks.

    I figured it out by moving the variable assignment right before the redirect to the next page.

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

  • Insert multiple records into Oracle using Java

    Hi,
    Has anyone tried to insert multiple records into an Oracle table from Java? I have my data in a Java collection.Can I send a Java Collection to an Oracle Package as a PL/SQL Table Type? My problem is I dont want to instantiate a CallableStatement object everytime I do an insert. Instead I want to do that only once and then insert multiple records in one operation.
    Any suggestions will be appreciated,
    Thanks,
    Alex

    Hi Mensa,
    I went thru the code example in your book in chapter 8 (downloaded it from OTN). It looks like the java code for "public class myPLSQLIndexTab" might be a java stored procedure stored in the oracle database?
    Pardon my ignorance because I've never worked on java code in the oracle database itself but how would I call such a program outside the oracle database? For example say I have a batch job that downloads data from a webservice and that batch job is written in java and its sitting on a batch server somewhere on the network. But the java program that inserts data into the database is sitting in the oracle database (also somewhere in the same network). How can the java code sitting on the batch server talk to the java code sitting on the oracle server? Is it the same as calling a pl/sql package using CallableStatement?
    Thanks
    Alex

  • How to insert new record into oracle table from GridView in VS2005.

    I need to insert records into Oracle10g table from VS2005 GridView using the Insert Method in Business Logic Class. The Update and Delete Methods are working fine. What's the best way out?

    How is it "not possible"?
    Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
    Where's the problem?

  • Inserting a record into ORACLE table from a webdynpro application

    Hi,
    From My webdypro code I have 10 attributes which are need to  be inserted into a ORACLE DB table. Can anyone suggest me how to achieve it or Can you please point me a tutorrial which can help on it.
    All the attributes will be inserted in a single record.
    Thanks,
    James

    check this code
    Created on Oct 18, 2007
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package com.psft;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.StringTokenizer;
    @author BALU
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class DataBaseDAO
         ResultSet rs;
         int qID = 1;
         int noOfChoices=0;
         Connection con;
         Statement stmt;
         public DataBaseDAO()
              try{
                   /*Class.forName("oracle.jdbc.driver.OracleDriver");
               con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","bduvvuri","dbsub516");
               stmt = con.createStatement();*/
               DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
               Class.forName("oracle.jdbc.driver.OracleDriver");
               String s ="jdbc:oracle:thin:@192.168.9.34:1527:ep7";
               con=DriverManager.getConnection(s,"user1","welcome1");
               stmt = con.createStatement();
              }catch(Exception e){}
         public int register(String name,String pass,String emailid){
              int i =0;
              try{
                   PreparedStatement ps = con.prepareStatement ("Insert into USERS(username,password,email) values (?,?,?)");
                   ps.setString( 1, name);
                   ps.setString( 2, pass);
                   ps.setString( 3, emailid);
                   i = ps.executeUpdate();
                   }catch(Exception e){
                   System.out.println("ee"+e.getMessage());
              return i;
    xxxxxx (please read forum rules)
    Edited by: Armin Reichert on Jan 17, 2008 10:17 AM

  • Urgent help : how when insert new record navigation off

    hi master
    Sir
    when i insert new record by mistake press down key and curser move to next record and my need is
    When I insert new record or change any record that time my form navigation musht be off and no move to next record how I restrict to navigation please give me idea which event and what code I use
    Thanking you
    aamir

    If u want the cursor not to move ahead from a particular field when the records are inserted or updated on that field then u can just write null to the
    key-next-item trigger of that particular item.
    ie IN key-next-item
    null;
    Hope this is what you wanted.

  • Select query for every 1000 records

    Hi all ,
             Please help me in the issue . I am using select query Select * from table up to 1000 rows for acheving the records but i want this process to retrigger once the process of 1000 records is compleded again it needs to fetch the next 1000 records and process the same . I am changing the status of the processed records once it is processed . Can can one tell me how to retrigger the select query once the 1000 records are processes.
    Thanks in advance,

    Hi Eric,
                  After selecting the 1000 records, find the key value of the last record. Build up the range as GT. Again use the select query.
    For example,
    Select * into table lt_data from ztab
    where key in r_key
    up to 1000 rows.
    regards,
    Niyaz

  • Update/Insert records from Oracle to MySQL

    Hi team, 
    My application will insert/update records into Oracle database, I need to sync all of records into MySQL database.  I designed a package to load data from Oracle to MySQL, the Oracle database use OLE DB component and MySQL database use ADO.NET.
    How to insert new records into MySQL? If the old record exists, we also need to replace with new record. I did some research, someone suggest to create a stage table to handle this scenario, but I have 14 tables in this case. How to handle this scenario
    with high performance? 
    If there is anything unclear, please let me know. 
    Thank you in advance. 

    Finally, I created 14 tables as same as in our MySQL database system with prefix "updated" , they are use to store the updated records from Oracle system. All of new records we add a flag, the "1" means insert a new record into the system,
    and the "0" means we should updated. So, I can use the conditional split component to split all of new records. The new records insert into the target table and the updated records insert into the "updated_table". Finally, we can add a
    SQL Script task to run a update script to sync all of records. 
    I don't use Lookup Transformation because we must use Cache
    Transform transformation in this case, the Cache connection manager to save the data to a cache file (.caw), it will hard to
    trace the history data in the future.  
    In addition, I recommend to use ODBC connection if somebody face the similar scenario with me, there is a bug  if we use ADO.NET to
    load data from Oracle to MySQL by using SSIS. For more information, please refer the MSDN document: http://blogs.msdn.com/b/mattm/archive/2009/01/07/writing-to-a-mysql-database-from-ssis.aspx
    @Arthur, thanks again for your input.  Have a nice day! :)

  • Need to fatch the data from sqlserver to Oracle DATABASE ;not migration

    Hello,
    What is the easiest method to insert/refresh data into Oracle Tables from SQLSERVER 2005 table.Do I need ODBC connection and how it works in the PL/SQL to create the connection and fetch the data from sqlserver.
    Thanks,
    Sarabmann

    I need to fetch from ORACLE back-end ,for example I want to install the mechanism at the back-end server where if I write stored procedure and call this link which enable me to fetch the data from sqlserver.
    Environment:- Linux as OS
    Oracle 10G as a Database

  • Commit for every 1000 records in  Insert into select statment

    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
       from emp e , dept d
      where e.deptno = d.deptno       ------ how to use commit for every 1000 records .Thanks

    Smile wrote:
    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.Does the another table already have records or its empty?
    If its empty then you can drop it and create it as
    create your_another_table
    as
    <your select statement that return 60000000 records>
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .That is not the best way. Frequent commit may lead to ORA-1555 error
    [url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:275215756923]A nice artical from ASKTOM on this one
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
    from emp e , dept d
    where e.deptno = d.deptno       ------ how to use commit for every 1000 records .
    It depends on the reason behind you wanting to split your transaction into small chunks. Most of the time there is no good reason for that.
    If you are tying to imporve performance by doing so then you are wrong it will only degrade the performance.
    To improve the performance you can use APPEND hint in insert, you can try PARALLEL DML and If you are in 11g and above you can use [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_parallel_ex.htm#CHDIJACH]DBMS_PARALLEL_EXECUTE to break your insert into chunks and run it in parallel.
    So if you can tell the actual objective we could offer some help.

  • Trigger for every 1000 record insert

    Hi
    I am working in oracle 9i / Aix 5.3
    I need a trigger which should fire whenever my temp_table growing 1000,2000...etc.,
    The records should reach me in the body of email.
    Like
    Hi
    The temp_table count has been reached to 1000.
    Thanks
    second time execution...
    Hi
    The temp_table count has been reached to 2000.
    Thanks
    etc.,
    How can i achieve this? I'm ok to shell script also for the above functionality
    Thanks
    Raj

    Why do you want to do this?
    SQL> create table temp_table (x number);
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function temp_table_cnt return number is
      2    pragma autonomous_transaction;
      3    v_cnt number;
      4  begin
      5    select count(*) into v_cnt from temp_table;
      6    return v_cnt;
      7* end;
    SQL> /
    Function created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace trigger trg_a_temp_table
      2  after insert on temp_table
      3  for each row
      4  declare
      5    v_cnt number;
      6  begin
      7    v_cnt := temp_table_cnt();
      8    if mod(v_cnt,1000) = 0 then
      9      dbms_output.put_line('Email Sent for '||v_cnt||' records.');
    10    end if;
    11* end;
    SQL> /
    Trigger created.
    SQL> set serverout on
    SQL> ed
    Wrote file afiedt.buf
      1  begin
      2    for i in 1..3456
      3    loop
      4      insert into temp_table values (i);
      5      commit;
      6    end loop;
      7* end;
    SQL> /
    Email Sent for 0 records.
    Email Sent for 1000 records.
    Email Sent for 2000 records.
    Email Sent for 3000 records.
    PL/SQL procedure successfully completed.
    SQL>... however I wouldn't consider this good design, as it requires each of the rows to be committed so that the autonomous transaction procedure can count the number of rows on the table. Of course, if the rows are being inserted through, let's say, user input and are committed on a 1 by 1 basis anyway, then it's perfectly acceptable, but I wouldn't use it for bulk insertions.

  • Need to insert selected records from PROD into TEST

    I am trying to insert all records (for a specific region only) from production to test.
    I'm a little confused about how the pl/sql would look for this.
    Note that as I insert into the table in test, I also have a key field that is auto incremented by 1 each time.
    The problem that I am having is I need to link two tables in PROD together to determine the region:
    So in test, I want to do something like:
    INSERT INTO ACCOUNT_PRICE
    (select * from ACCOUNT_PRICE@PROD, MARKETER_ACCOUNT@PROD
    where substr(MARKETER_ACCT_NO,1,1) = '3'
    and MARKETER_ACCOUNT_NO = PRICE_ACCOUNT_NO);
    However, i'm not sure if this is correct or if I should be using a BULK insert.
    Note that I cannot just load the whole table as I need to restrict it to only one region of data.
    Any help would be appreciated.
    Sean

    Direct load (BULK) is irrelevant to what you are asking. I would strongly suggest that you read the docs about this feature before considering it for any purpose.
    As to your question what you are asking is unclear and, for reasons known only to you, you did not include a version number.
    So given that I get to invent your version number I have decided you have 10g and therefore you have DataPump so my recommendation is to use
    DataPump to extract and export the records you wish to move.
    http://www.morganslibrary.org/reference/dbms_datapump.html

Maybe you are looking for

  • Is it possible to buy the HD version of a movie on iTunes after buying the SD one?

    I bought the SD version of a movie online, and I want the HD version now. Is it possible to get the HD version when I already have a copy of the movie (in a different version)? Do I get a discount if it is possible? Thanks

  • CRM - Pricing User Exit in Java - BADI CRM_COND_COM_BADI

    Hi All I have to convert some user-exit from Abap to Java in order to work in CRM Pricing Scenario (I use VMC technology based on Web AS 7.00). In the manual attached to note 809820 (New userexit concept for pricing) I find this chapter but I don't u

  • Smartforms data not printed

    Hi,       I was creating a smartform and it is printing the layout correctly.. But at the right end corner now i want to display the address from the db table.SAo i captured in the internal table and the values stored properly in inthernal table. But

  • Does Apple plan on integrating Genius to the Trailers section on the AppleTV?

    One of my favorite features on the AppleTV (still a 1st Gen owner but I have friends and family that own the 2nd Gen) is the movie trailers.  I was wondering/hoping that Apple could integrate something like Genius in to the Trailers section for a mor

  • SUP input parameter Clarifications

    Hi all, I have a scenario to pass the input paramter to RFC and get the output list. What is the best way to do it? Can any one please explain about the sync parameter as the load paramter concepts and steps?? Regards, Ram