2

I have a alter query

ALTER TABLE Table_name  ADD(coumn1  DOUBLE,coumn2  DOUBLE);

I am using

this.namedParameterJdbcTemplate.execute(alterTableSQL, namedValues, new PreparedStatementCallback<Boolean>() {
    @Override
    public Boolean doInPreparedStatement(PreparedStatement ps) throws SQLException, DataAccessException {
        return ps.execute();
    }
});

While executing the statement, it is throwing me the following exception.

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [ALTER TABLE <sample>  ADD (
 coumn1  DOUBLE,
 coumn2  DOUBLE
);]; nested exception is org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "ALTER TABLE TEMPLATE_1  ADD ([*]
 coumn1  DOUBLE,
 coumn2  DOUBLE
); "; expected "identifier"; SQL statement:
ALTER TABLE template_1  ADD (
 coumn1  DOUBLE,
 coumn2  DOUBLE
); [42001-160]

How should I proceed on this?

Gangaraju
  • 4,406
  • 9
  • 45
  • 77
vamsi
  • 1,219
  • 1
  • 9
  • 15

0 Answers0