Duplicate/copy tables with data in ibatis

Posted on 2009-12-19
Last Modified: 2012-05-08
I want to update my current table using ibatis as below,

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

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
Question by:mwhc
    LVL 82

    Accepted Solution

    >>But before that i want to copy the current playergame table for backup purpose
    You need to execute a SELECT INTO query:
    LVL 26

    Assisted Solution

    you need a code like this

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

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now