首页 > 解决方案 > 获取绑定消息提供 2 个参数,但准备好的语句“”在尝试从 nodejs 应用程序运行 postgresql 查询时需要 0 个错误

问题描述

获取绑定消息提供 2 个参数,但准备好的语句“”在尝试从 nodejs 应用程序运行 postgresql 查询但在 pg admin 中同样工作时需要 0 个错误

下面提到的查询我正在尝试运行:

query="select array_agg(zonename) from bitargetstg.tax_program_zones where coalesce(SHAPE_Area,0) >0 and (ST_Contains(ST_GeomFromEWKT(Geometry),"+

"ST_GeomFromText('POINT($1 $2)')) 或 ST_intersects(ST_GeomFromEWKT(Geometry), ST_GeomFromText('POINT($1 $2)')))";

标签: postgresql

解决方案


字符串文字中没有参数替换,因此$1$2是按字面意思理解的。


推荐阅读