I am using java 8 and have an update query with 3 columns concatenated to one in the where clause. the query works perfectly in the SQL Server , but when I execute from the code , it results in Incorrect syntax error.
<code>Query used in the code :
@Modifying
@Transactional
@Query(value = "UPDATE ListView SET stre_group = :streGroup, method = :mthodSelected, " +
"alloc_schedule = :allocationSchedule " +
"WHERE concat(job_id,':',item_nr,':',whse_nr) IN (:resultValue)", nativeQuery = true)
void updateWorklist(String streGroup, String mthodSelected,
List<String> allocationSchedule ,
List resultValue);
DB :
UPDATE tablename SET stre_group = 'store 4', method = 'store 4',
auto_alloc_action = 'store 4', alloc_schedule = 'store 4'
WHERE concat(job_id,':',item_nbr,':',whse_nbr) IN ('1:10:1')
</code>
<code>Query used in the code :
@Modifying
@Transactional
@Query(value = "UPDATE ListView SET stre_group = :streGroup, method = :mthodSelected, " +
"alloc_schedule = :allocationSchedule " +
"WHERE concat(job_id,':',item_nr,':',whse_nr) IN (:resultValue)", nativeQuery = true)
void updateWorklist(String streGroup, String mthodSelected,
List<String> allocationSchedule ,
List resultValue);
DB :
UPDATE tablename SET stre_group = 'store 4', method = 'store 4',
auto_alloc_action = 'store 4', alloc_schedule = 'store 4'
WHERE concat(job_id,':',item_nbr,':',whse_nbr) IN ('1:10:1')
</code>
Query used in the code :
@Modifying
@Transactional
@Query(value = "UPDATE ListView SET stre_group = :streGroup, method = :mthodSelected, " +
"alloc_schedule = :allocationSchedule " +
"WHERE concat(job_id,':',item_nr,':',whse_nr) IN (:resultValue)", nativeQuery = true)
void updateWorklist(String streGroup, String mthodSelected,
List<String> allocationSchedule ,
List resultValue);
DB :
UPDATE tablename SET stre_group = 'store 4', method = 'store 4',
auto_alloc_action = 'store 4', alloc_schedule = 'store 4'
WHERE concat(job_id,':',item_nbr,':',whse_nbr) IN ('1:10:1')
I tried to check on the syntax and not getting what is the issue with the query.
Please help.