postgresql - 获取绑定消息提供 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)')))";
解决方案
字符串文字中没有参数替换,因此$1
和$2
是按字面意思理解的。
推荐阅读
- java - Character Reversal without reversing numbers
- python-3.x - Loading dataset in UINT8 format- python
- c++ - Win32 MFC OnPaint Resizing and Redrawing handling
- python - Python: vectorizing a function call which uses an array of objects
- hardware - What does the term "assert" mean in respect of hardware (bus) signals?
- php - How can I set value to file in php?
- image - How do I get an image to show on black only?
- ios - Is it possible to call editActionsForRowAt of UITableview manually?
- java - Javers - How to use custom tables
- ssh - What is the best way to remotely edit a file using VS code?