Hierarchical Query with clause “START WITH” not work when use IN subquery as condition when using JdbcTemplate

the problem is this query (as @AlexPoole make an observation)

SELECT 
   b.TEAM_PARENT_ID 
FROM 
   TB_EMPLOYEE b 
WHERE 
   b.EMP_ID IN (:TARGET_EMP)

the cause of problem is b.EMP_ID in table TB_EMPLOYEE contain white space, and got no result at JdbcTemplate but at DBeaver have result (I still don’t understand why DBeaver got result), so I fix the query by turn b.EMP_ID IN (:TARGET_EMP) to be trim(b.EMP_ID IN (:TARGET_EMP).

Thank you for all help.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top