1

I can not get it to work. I started with complex sql and ended with 'hello word' example, but I get errors: My sqls are:

  • SELECT t.id, t.user_id, t.coordinates, t.size, t.price FROM my_table t WHERE t.id=%id_param% Error: Failed to create SQL view: ERROR: syntax error at or near ")" Position: 100
  • SELECT t.id, t.user_id, t.coordinates, t.size, t.price FROM my_table t WHERE t.id='%id_param%' Error: Failed to create SQL view: ERROR: invalid input syntax for integer: "" Position: 100

I am not sure, what I am missing. I am using approx 2 months old OpenGeo suite (4.0.2).

About GeoServer General information about GeoServer Build Information Version 2.4-SNAPSHOT Git Revision f295d37d70c3b1f0e51942e8b031253e4d75459 Build Date 20-Jan-2014 22:29 GeoTools Version 10-SNAPSHOT (rev 3bb3df4f410750baf9ebc48c9c475a70642aadb6) GeoWebCache Version 1.5.0 (rev 1.5.x/f981cafd349886bb2a1ef45067f26b1aa8e4aff4)

2 Answers 2

3

Have you set a Default value for the id_param under the SQL view parameters section? Try using your first query (without the quotes) and entering 0 for under the default value

1
  • OMG. Simple but obscure...
    – Auspex
    Commented Jan 6, 2023 at 10:25
0

Perhaps you are missing the select syntax with "like" as described in this post

5
  • LIKE for interger field?
    – Makla
    Commented Apr 30, 2014 at 10:07
  • you have never told us that "id_param" was a integer field. I edited my answer. Commented May 3, 2014 at 19:36
  • I though that is logic based on field name.
    – Makla
    Commented May 4, 2014 at 13:04
  • Does the syntax work in pgadmin or psql? Commented May 5, 2014 at 7:10
  • Yes it does work in pgadmin, but not geoserver.
    – Makla
    Commented May 5, 2014 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.