Question mark sign "?" special treatment inside SQL

已回答

IDEA treats "?" as a parameter inside SQL. How can i remove this behavior. I need to create operator.

0

See this answer on StackOverflow:

Depending on the JDBC driver you are using you may be able to escape by adding another question mark e.g. if you're using PostgreSQL

https://jdbc.postgresql.org/documentation/head/statement.html

 In JDBC, the question mark (?) is the placeholder for the positional parameters of a PreparedStatement. There are, however, a number of PostgreSQL operators that contain a question mark. To keep such question marks in a SQL statement from being interpreted as positional parameters, use two question marks (??) as an escape sequence. You can also use this escape sequence in a Statement, but that is not required. Specifically only in a Statement a single (?) can be used as an operator.

 

 

0

请先登录再写评论。