[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 667
  • Last Modified:

Duplicate/copy tables with data in ibatis

I want to update my current table using ibatis as below,

      <update id="resetScore">
            UPDATE playergame SET score=0
    </update>

But before that i want to copy the current playergame table for backup purpose. How can i duplicate the table with data, but into diff name, like playergame_ddmmyy_hhmm, all within ibatis
0
mwhc
Asked:
mwhc
2 Solutions
 
hieloCommented:
>>But before that i want to copy the current playergame table for backup purpose
You need to execute a SELECT INTO query:
http://www.w3schools.com/Sql/sql_select_into.asp
0
 
tigin44Commented:
you need a code like this

  <duplicate id="duplicateData">
            SELECT * INTO playergame_copy FROM playergame
    </duplicate>
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now