In the case of inserting a record into table using oracle, you don't have to select the table prior to inserting. So, I guess it is best for you to take out the portion that you select * from tablename and instead, straight away use the "Insert" command.
That should reduce your accessing time and also should increase your performance a bit.