title: NamedParameterJdbcTemplate cannot execute insert into select
body: <p>I'm using informix and I'm trying to execute a simple query from java using spring. This is the query.</p>
  
  <pre><code>INSERT INTO table1
  SELECT val1, val2, val3
  FROM table2
  WHERE condition
  </code></pre>
  
  <p>I've verified the query syntax and if execute it using a client, runs perfectly. But when it runs using <code>NamedParameterJdbcTemplate</code> throws syntax error and I don't know why. Somebody could explain me the reasons and a good way to solve my problem.</p>
  
  <p>This is my java code.</p>
  
  <pre><code>String LOG_INFO = 
     "INSERT INTO table1 SELECT val1,  val2,  (SYSDATE - 5 UNITS HOUR),  val3 " +
     " FROM table2 " +
     " WHERE membership_nbr = :user_nbr_param";
  String USER_NBR_PARAM = "user_nbr_param";
  
  @Autowired
    private NamedParameterJdbcTemplate jdbcTemplate;
  
  public Integer logInfo(BigInteger userNbr) {
      MapSqlParameterSource params = new MapSqlParameterSource();
      params.addValue(USER_NBR_PARAM, userNbr);
  
      return jdbcTemplate.update(LOG_INFO, params);
    }
  </code></pre>