Exforsys
+ Reply to Thread
Results 1 to 6 of 6

Insertion of multiple values using a single insert statement in oracle 10g

This is a discussion on Insertion of multiple values using a single insert statement in oracle 10g within the Oracle Database forums, part of the Database category; Hey i am trying to insert multiple values in a table using a single insert into statement.I just wanted to ...

  1. #1
    simplyshravan is offline Junior Member Array
    Join Date
    Sep 2008
    Answers
    1

    Insertion of multiple values using a single insert statement in oracle 10g

    Hey i am trying to insert multiple values in a table using a single insert into statement.I just wanted to avoid writing multiple insert into statements for entering data into a table.Is there any way i can do this.

    I tried this way

    create table ike
    (Name varchar(25),
    age number(3),
    phn number(10),
    salary number(9,2));

    i created this table and tried unserting values

    insert into ike('&name',&age,&phn,&salary);
    Enter value for name:
    Enter value for age:
    Enter value for phn:
    Enter value for salary:
    When i entered the values it read an error message
    Error at line 2
    ORA 00928:missing Select keyword in line 1.

    i then tried to enter agai by using backslash(/)
    SQL>/
    but it showed me the same error..
    could any 1 make out a point of this...

    I have seen a post about this here but i could'nt find it now.
    Thanx in advance

    Last edited by simplyshravan; 09-16-2008 at 10:33 PM. Reason: Made my doubt more cleared to the viewers

  2. #2
    oraclegeek is offline Junior Member Array
    Join Date
    Sep 2008
    Answers
    1
    You can trying insert into (select statement) to load the data; can you be more specific


  3. #3
    stevebucknor1 is offline Junior Member Array
    Join Date
    Jan 2011
    Answers
    14
    You can trying insert into (select statement) to load the data; can you be more specific. This thing always remember. It is really amazing and outstanding.


  4. #4
    sunil_more is offline Junior Member Array
    Join Date
    Jan 2012
    Answers
    1
    as like

    insert into <source table> select * from <dist table>


  5. #5
    lokeshm is offline Member Array
    Join Date
    Apr 2005
    Answers
    64
    Hello,

    Here is another way to insert multiple records with one insert

    Code:
    INSERT INTO `category` (`cat_id`, `cat_pid`, `cat_name`, `cat_url`, `cat_desc`, `cat_mttl`, `cat_mkey`, `cat_mdsc`) VALUES
    (1, 0, 'Certification', 'Certification', '', '', '', ''),
    (2, 0, 'Java', 'Java', '', '', '', '');
    Thanks


  6. #6
    coolcub is offline Junior Member Array
    Join Date
    Feb 2012
    Answers
    1

    Cool

    insert into ike(name,age,phn,salary)
    values(&name,&age,&phn,&salary);


    execute above statement then you will be asked to enter values as shown
    enter value for name:
    enter value for age:
    enter value for phn:
    enter value for salary:

    provide details one by one. all your data will be inserted

    (or)

    type complete sql query in notepad along with semicoln for all values and then copy paste it in SQL plus command line.
    all values will be inserted at once.
    ex:
    write queries in notepad like:

    insert into friends values(002,'satish','kolar','ait','ec','098hh');
    insert into friends values(003,'srinivas','mysore','ait','ec','099hh');
    insert into friends values(004,'arjun','kolar','jss','ec','048hh');

    copy paste all querries will executed automatically and will be inserted into the table.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...