SQL
name LIKE CONCAT('%', #{name}, '%')
报错
ERROR: could not determine data type of parameter $7
分析
大概意思指的是:无法确定参数类型,只需要对 #{name} 进行类型转换就行,给它一个明确的类型即可。
解决
name LIKE CONCAT('%', #{name}::varchar, '%')
name LIKE CONCAT('%', #{name}, '%')
ERROR: could not determine data type of parameter $7
大概意思指的是:无法确定参数类型,只需要对 #{name} 进行类型转换就行,给它一个明确的类型即可。
name LIKE CONCAT('%', #{name}::varchar, '%')