Announcement Announcement Module
Collapse
No announcement yet.
Issue with NamedParameterJdbcTemplate using list as a parameter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with NamedParameterJdbcTemplate using list as a parameter

    Hi,

    I would like to execute below SQL query using JDBCTemplate OR NamedParameterJdbcTemplate.

    DELETE FROM bar WHERE foo IN (hextoraw('X'),hextoraw('X'),hextoraw('X'));

    Map<String, Object> namedParameters = new HashMap<String, Object>();
    namedParameters.put("testList", testList);

    int rowsDeleted = getNamedParameterJdbcTemplate().update(deleteQuery , namedParameters);

    How to pass hextoraw() function to each parameter value?

    when getNamedParameterJdbcTemplate().update() excutes I want generated SQL query should look like this

    DELETE FROM TABLE WHERE COLUMN_ID IN (hextoraw(?),hextoraw(?),hextoraw(?));

    Is there way we can do this? Please help me.

    Thanks
Working...
X