title: How do I create an alter table statement with MyBatis? MySQLSyntaxErrorException: You have an error in your SQL syntax
body: <p>I have the following</p>
  
  <pre><code>@Mapper
  public interface StatMapper {
      @Update("alter table stats reorganize partition #{pFirst},#{pSecond} into ( "
              + "partition #{pSecond} values less than (#{dSecond}) "
              + ");")
      public void updateFirstPartition(@Param("pFirst")String pFirst, @Param("pSecond")String pSecond, @Param("dSecond")LocalDate dSecond);
  </code></pre>
  
  <p>It gives the following error</p>
  
  <blockquote>
    <p>2019-09-30 21:58:23.067 DEBUG 13728 --- [  restartedMain] c.s.s.m.StatMapper.updateFirstPartition  : ==>  Preparing: alter table stats reorganize partition ?,? into ( partition ? values less than (?) );
    <br>    2019-09-30 21:58:23.093 DEBUG 13728 --- [  restartedMain] c.s.s.m.StatMapper.updateFirstPartition  : ==> Parameters: p20180901(String), p20181001(String), p20181001(String), 2018-10-01(Date)
    <br><br>    Caused by: org.springframework.jdbc.BadSqlGrammarException:
        ### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''p20180901','p20181001' into ( partition 'p20181001' values less than ('2018-10-' at line 1</p>
  </blockquote>
  
  <p>How can I issue this <code>alter table</code> statement using MyBatis?</p>
  
  <p>The statement should look like this (<code>p0</code> and <code>p1</code> substituted by <code>p20180901</code> and <code>p20181001</code>):</p>
  
  <pre><code>alter table stats reorganize partition p0,p1 into (
      partition p1 values less than ('2018-10-01')
  );
  </code></pre>