I wanted to add the a varible in the prepareded statement and
String Query = "SELECT count(*) count from apps.fnd_user fu where "
+ "UPPER(fu.user_name) like 'ADMIN_ ||:1||' ";
PreparedStatement stmt = conn.prepareStatement(Query);
stmt.setString(1, CompanyName);
yet this error is showing . Any Fix for this mistake ..... can i concat using pipes while preparing the statement.
Don't concatenate in SQL. Do it in Java:
Note that:
?
, not:1
If you insist on doing it in SQL, the syntax would be (using Concatenation Operator):
Or (using
CONCAT()
function):