How to insert 10,000 records test data into the emp table

Hi I am new to oracle can someone please help me write a program so that I can insert the test data into the emp table
SELECT       LEVEL empno,
             DBMS_RANDOM.string ('U', 20) emp_name,
             TRUNC (DBMS_RANDOM.VALUE (10000, 100000), 2) sal,
             DBMS_RANDOM.string ('U', 10) job,
             TO_DATE ('1990-01-01', 'yyyy-mm-dd')
             + TRUNC (DBMS_RANDOM.VALUE (1, 6000), 0)
               hiredate,
             CASE
               WHEN LEVEL > 10 THEN TRUNC (DBMS_RANDOM.VALUE (1, 11), 0)
               ELSE NULL
             END
               mgr,
             TRUNC (DBMS_RANDOM.VALUE (1, 5), 0) deptno
FROM         DUAL
CONNECT BY   LEVEL <= 10000

Tags: Database

Similar Questions

  • How to insert the legacy data into the QP_RLTD_MODIFIERS table?

    How insert Legacy data into the QP_RLTD_MODIFIERS table in the instance of R12.

    I would use the QP_Modifiers_PUB API. Process_Modifiers to push the old data on prices in R12.  QP_RLTD_MODIFIERS is only used for certain types of discounts (in my prod environment, only the promos are given in this table).

  • ADF progress indicator to insert the data into the file table.

    I have a requirement where the progress bar should indicate the percentage of completion to insert the data into the tables of database files in a given folder path. I found an article that explains how to get the progress indicator when downloading a file in
    http://www.gebs.ro/blog/Oracle/Oracle-ADF-progress-indicator-in-Fusion-Middleware-11g/. I believe that I must first get the total number of files in the folder and then begin to compare with the number of files that are inserted into the table similar to what is done by downloading (getting the file size and download size), but I don't know how to do this. Can anyone help?

    May be that this example allows you to

    * 042.     Dynamically change the color of progress bar based on its current value *.

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html

  • Insert data into the same table based on certain conditions

    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & & CurrentInstallment < TotalInstallment then

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit on each record selected and insert data and then turns them into table (MYTABLE) even.

    How to achieve that?

    Thank you.

    978184 wrote:
    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & CurrentInstallment

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit & on each of the selected data record and insert then turns them into table (MYTABLE).

    You can do this way:

    This is not tested, but if you can provide the example of table structure and data (IN create table and insert scripts), it can be put to the test.

    insert into your_table
    (col1, col2, col3...current_installment, month_field)
    select col1, col2, col3..,
           current_installment +
           case when paidamount > 0 and current_installment < total_installment then
            row_number() over (
                                partition by column1, column2,.. columnn      -->You may choose partition if you want the
                                                                              --Increment of Current_installment to reset after particular combination ends
                                order by primary_key        -->Order the Increment, you may choose to add more columns to order by
                              )
          else
            0                                               --> if condition is not met, then Add 0
          end curr_installment,
          add_months(to_date(month_field, 'MM/YYYY'), 1) nxt_month
      from your_table;
    
  • cannot insert data into the PRODUCT_USER_PROFILE table

    I've connected to the database as the sysdba, which is installed on VMWARE. database is oracle 11g.
    whenever I insert data in the table PRODUCT_USER_PROFILE that the database returns 1 row inserted and then when I try to show everything on the table before or after the statement commit is made the database returns "No. LINES SELECTED.

    guys any idea about this problem...

    Hello

    Try to connect as a system and make the insert and check. Always think about the issue.

    -Pavan Kumar N
    Oracle 9i / 10g - OCP
    http://oracleinternals.blogspot.com/

    Published by: pounet on January 4, 2010 16:29

  • How to display data from the emp table?

    Hi everyone, this is my first post in this portal. I want to display the details of the table emp... for this I use this SQL statement.

    Select * from emp where mgr = nvl(:mgr,mgr);

    When I give the entry as 7698 it shows the matching records... and also when I don't give any input then it shows all the records except the Archbishop with null values.

    (1) I want to display all the records when I do not give any input, including null values
    (2) I want to display all the records that a Bishop is null

    Is it possible to integrate in order to include all these in a single query.

    Hello

    937440 wrote:
    Hi everyone, this is my first post in this portal.

    Welcome to the forum!
    Don't forget to read the forum FAQ {message identifier: = 9360002}

    I want to display the details of the table emp... for this I use this SQL statement.

    Select * from emp where mgr = nvl(:mgr,mgr);

    When I give the entry as 7698 it shows the matching records... and also when I don't give any input then it shows all the records except the Archbishop with null values.

    (1) I want to display all the records when I do not give any input, including null values
    (2) I want to display all the records that a Bishop is null

    Is it possible to integrate in order to include all these in a single query.

    It's a little unsure what you're asking.
    The following query always includes the lines where mgr is NULL and when the binding variable: mgr is NULL, it displays all the lines:

    SELECT  *
    FROM     emp
    WHERE     LNNVL (mgr != :mgr)
    ;
    

    In other words, when: 7698 = mgr, it displays 6 rows and when: mgr is NULL, it displays 14 rows (assuming you are using the table provided by Oracle scott.emp).

    The following query includes lines where Bishop is ZERO only when the binding variable: mgr is NULL, in which case it shows all lines:

    SELECT     *
    FROM     emp
    WHERE     :mgr     = mgr
    OR       :mgr       IS NULL
    ;
    

    When: mgr = 7698, this will display 5 rows and when: mgr is NULL, it displays 14 rows.

    The following query includes lines where Bishop is ZERO only when the link variab; e: mgr is NULL, in which case it shows only those rows where mgr is NULL. In other words, it treats NULL as a value:

    SELECT     *
    FROM     emp
    WHERE     DECODE ( mgr
                , :mgr, 'OK'
                )     = 'OK'
    ;
    

    When: mgr = 7698, this will display 5 rows and when: mgr is NULL, it displays 1 row.

  • Load xml data into the table

    Hi all

    I have an XML (emp.xml) with data below:

    -< root >
    -< row >
    < name > steve < / lastname >
    < 30 > < / Age >
    < / row >
    -< row >
    < name > Paul < / lastname >
    <>26 < / Age >
    < / row >
    < / root >

    I would like to create a stored procedure to store the xml data into the EMP table.

    EMP
    LastName age
    Steve 30
    Paul 26

    I tried to watch all threads related to this forum, but cannot find the right wire. Any help is greatly appreciated. Thank you

    With

    SQL>  select * from xmltable('root/row' passing xmltype('
    
    steve
    30
    
    
    Paul
    26
    
    ') columns lastname path 'lastname',
                       Age path 'Age')
    /
    LASTNAME   AGE
    ---------- ----------
    steve      30
    Paul       26   
    

    You can now just make a

    Insert into emp as select...

  • Loading the data into the order of series of Timestamp

    I need to load data into the target table in the order of series of timestamp. How to do it.

    ex:

    2015-12-10 02:14:15

    2015-12-10 03:14:15

    2015-12-10 04:14:15

    After you follow the how to use the Direct-Path INSERT ordered by your "timestamp column" series described here above, you can sort the lines in ODI (order of) this way:

  • import data into the table with the triggers of the sequence

    Hello

    I'm on oracle 11G on OS SPARC.

    I need to import a table from a dump using "imp."

    At the destination table where I have to import a 'insert before' with the sequence as the primary key.

    Suppose if I am importing data that has the sequence from 200... then when I imported the data into the new table, I have to define the sequence to be the same as the boot sequence for the source or it will automatically use this source sequence.


    Please suggest

    concerning
    Kkurkeja

    Disable the trigger prior to importation.

    Thank you

  • How insert/DML data in the table when the data in the related table changes

    Hello guys!

    I came across a problem that I need to get fixed. Because I don't know how to start and get it resolved I wanted to ask you for your expertise.

    The scenario is as follows:

    I have a table 'a' in my 10g database and a view "ab" which combined table 'a' with 'b' table in a view. However, the 'b' table is a table in another schema Manager database. and accessible (read only right) via a database link.

    Now here it is: whenever the data changes in table "b", for example 2 new sets of data is inserted, I need to insert automatically the 2 values of these 2 sets of data in my table "a". Same procedure for update and delete in table "b".

    The action that inserts data into the table 'a' must be initialized in my database, I have limited access to the other. Can I somehow use a trigger my reviews of "ab" to insert data into the table "a"? Or is it possible to use the "change notification procedure database" using the view as the reference?

    Desperately need help and example of all suspicion/code greatly appreciated. I am very new to Oracle and not very fond of PL/SQL routines. So please be so kind as to give me more details.

    Thanks in advance - I hope you have any ideas how I can get this problem resolved.

    Sebastian

    >

    ... it does not, since the DDL operations are not permitted on the remote databases (ORA-02021). I can't create the trigger on a view either. :-(
    So what ways are left to insert data into the table 'a' when the related table changes?

    Please, help if you have an idea!

    Yes,
    You can't perform the DDL (create the trigger...) on remote databases as you can see...
    Try to create this trigger in the local database that will make DML (insert into...) on the remote database.

        CREATE OR REPLACE TRIGGER local_forward_pt_after_insert
         AFTER INSERT
             ON N2K_INV_PT
             FOR EACH ROW
    
         BEGIN
             -- Insert records into table "a"
             INSERT INTO TBL_PUNKTDATEN@remote_database_sid
              ( INT_NUMMER,
                STR_GEBIET
                 )
             VALUES
              ( :new.INT_INV_PT_NR,
                :new.GEBIET );
         END;
    

    Thank you

    Good luck

  • How to insert data into the table by using the expression builder in the assign activity

    How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
    Can someone help me please

    Hello

    I don't think that oraext:query-database() can insert data into the table.

    What are your needs?
    Can not you plan to use the DB adapter with the insert operation?

    Kind regards
    Neeraj Sehgal

  • How to insert data into the database using smartview

    Hello
    I am trying to insert data into the database using * "Send data" * button on the Ribbon of Essbase.
    My database is empty.

    I opened an ad hoc network, it returns * "#missing" * in all cells
    I have modified the cells and provided data in the cells that I want to. Now, I supported on * "Send data" * button.
    It just reloaded the adhoc grid instead of submit data, I rechecked the data through data console Administrative Service are not inserted.

    I am following the right way to insert data? If not, could you please suggest me how (Populate) insert default data in the database?

    --
    VINET

    You go about it the right way, once you have submitted if you réactualisiez then data values should be there, if you POV is against members of dynamic calc and then data not written to the database, you need to check the Member properties of your POV.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to insert data into the BLOB column

    Hi all

    Can someone help me to insert data in the BLOB data type column?

    The structure of the table is
    CREATE TABLE XXATFL_DM_FORCAST_STG
    (
    TASK_ID NUMBER,
    USER_ID NUMBER,
    CREATED_BY NUMBER (15),
    CREATION_DATE DATE,
    LAST_UPDATED_BY NUMBER (15),
    DATE OF LAST_UPDATE_DATE,
    LAST_UPDATE_LOGIN NUMBER (15),
    RECORD_STATUS VARCHAR2 (1 BYTE),
    ERROR_MESSAGE VARCHAR2 (4000 BYTE),
    DATA_FILE BLOB
    )

    I want to insert data into the column DATA_FILE. and this insert statement inside a procedure.

    Please help me as soon as possible because it is very urgent for me

    Thank you and best regards,
    Charrier

    Charrier,

    If you form the string yourself, you can use the function utl_raw.cast_to_raw on your channel.

    http://download.Oracle.com/docs/CD/B12037_01/AppDev.101/b10802/u_raw.htm#997086

    sql> create table t(
      2    id number,
      3    l_blob blob
      4  );
    
    sql> insert into t values(1, utl_raw.cast_to_raw('SampleString'));
    
    1 row created.
    
    sql> commit;
    
    Commit complete.
    
  • What trigger to use to insert data into the table db forms

    Hello

    My form is current having a block of database with the table reference. When you enter data into the form field and click Save. Automatically record is inserted in the database table.
    I want to do this under manual insert. I changed the block of data to a data non-base. Where should I write the insert statement to insert data into the table.
    Is - shutter release key of the form-level validation?

    Please notify.

    Thank you
    Didi.

    You can guide me how to remove the message FRM-40401 no changes to save and instead, I wanted to put 1 transaction record successful... some like it like that.

    Hi didi.
    And this is my last post I'll sleep. ;)
    Take form level trigger named preform
    and write on it

    :SYSTEM.MESSAGE_LEVEL := 5;
    

    I hope this works...

    Hamid

    Mark correct/good to help others to get the right answers. *

  • Insert data as XML into the Oracle Table

    Hi all

    I have a requirement where the data in XML format, and I need to insert into the Oracle Table. For example, I get XML data in the following format,
    < results >
    < row >
    < BANK_ACCOUNT_ID > 10010 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    Vision operations < LEGAL_ENTITY > < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 10271-17621-619 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA-204 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 09 < / BALANCE_DATE >
    < LEDGER_BALANCE > 432705900.56 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10091 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300984 < / BANK_ID >
    Vision industries < LEGAL_ENTITY > < / LEGAL_ENTITY >
    Barclay Bank < BANK_NAME > < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 70986798 < / BANK_ACCOUNT_NUM >
    Bank Multi currency-626 < BANK_ACCOUNT_NAME > Barclays < / BANK_ACCOUNT_NAME >
    Reading < BRANCH_NAME > < / BRANCH_NAME >
    GBP < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 14 < / BALANCE_DATE >
    < LEDGER_BALANCE > 24244085.24 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10127 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    < LEGAL_ENTITY > SSC U.S. 01 < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 4898744 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA SSC U.S. 02-7188 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 28 < / BALANCE_DATE >
    < LEDGER_BALANCE > 10783815.28 < / LEDGER_BALANCE >
    < / row >
    < / results >

    I like to write PLSQL code that will receive these data with XML tags and insert it into the Oracle Table. Is this possible with built-in XML features provided in the Oracle database?

    Please Guide...

    Kind regards
    Priyanka

    But the problem is the file XML is to have the details of the records if you carefully observed the XML file. But by using more high statement select I get output in the following format.
    ORG_ID REQ_LINE PO_NUMBER EXPECTED_REC_QTY USER_NAME REQ_NUMBER
    204204 1444714450 11 64446445 11 OPERATIONSOPERATIONS

    The table has only one row, so you get a single row as output.
    I'm surprised that you find useful examples showing how to divide the data into several lines.

    (1) create the table with the following option, it will optimize the performance of storage and query for large XML documents:

    CREATE TABLE xxios_xml_data_test(xml_data XMLTYPE)
    XMLTYPE COLUMN xml_data STORE AS SECUREFILE BINARY XML
    ;
    

    (2) interview table with:

    SQL> select x.*
      2  from xxios_xml_data_test t
      3     , xmltable(
      4         '/Results/Row'
      5         passing t.xml_data
      6         columns ORG_ID           number       path 'ORG_ID'
      7               , REQ_NUMBER       number       path 'REQ_NUMBER'
      8               , REQ_LINE         number       path 'REQ_LINE'
      9               , PO_NUMBER        number       path 'PO_NUMBER'
     10               , EXPECTED_REC_QTY number       path 'EXPECTED_REC_QTY'
     11               , USER_NAME        varchar2(30) path 'USER_NAME'
     12       ) x
     13  ;
    
        ORG_ID REQ_NUMBER   REQ_LINE  PO_NUMBER EXPECTED_REC_QTY USER_NAME
    ---------- ---------- ---------- ---------- ---------------- ------------------------------
           204      14447          1       6444                1 OPERATIONS
           204      14450          1       6445                1 OPERATIONS
     
    

Maybe you are looking for