Back up contents in table data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kiss07
    Banned
    New Member
    • Jan 2007
    • 99

    Back up contents in table data

    Hello every one ,

    how to write an (procedure (or) trigger) which would enable me to copy the contents of one table to an another

    Table structure: oracle version is 9i:

    orginal table:

    create table temp(
    empno varchar2(5),
    name varchar2(40));


    back up table:

    create table temp_bakup(
    empno varchar2(5),
    name varchar2(40);
    );


    Expecting your replies,

    Arun..
  • frozenmist
    Recognized Expert New Member
    • May 2007
    • 179

    #2
    Hi Arun,
    What you have to do is create a procedure with a bulk insert in it.
    A bulk insert means
    Insert into table1
    (
    Select <columns> from table 2
    )

    If you want only those columns in table2 to be inserted in table 1 then you change the select statement accordingly.
    Insert into table1
    (
    select columns from table2 minus
    select columns from table1
    )

    Here table1 is your back up table and table 2 your original table
    Try it out. If you still have a problem please do reply.

    Cheers

    Comment

    Working...