# Perform these db tasks using a single function

**URL:** <https://www.ruby-forum.com/t/perform-these-db-tasks-using-a-single-function/113371>\
**Category:** Rails\
**Created:** [August 30, 2007, 1:19pm UTC](https://www.ruby-forum.com/t/perform-these-db-tasks-using-a-single-function/113371 "2007-08-30T13:19:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [August 30, 2007, 1:19pm UTC](https://www.ruby-forum.com/t/perform-these-db-tasks-using-a-single-function/113371/1 "2007-08-30T13:19:13Z")

</div>

hello frnds

I want to perform these tasks using a single function in ror

first select all records from table 1  
then create table named 2  
then copy the records to table 2  
and finally delete all records from table 1

Please let me know how to do it with ROR

Thanks

Dhaval P.
