Custom query bug

Wappler 5
MacOS
PostgreSQL
NodeJS

getting error on customer SQL query:
select (:P1 - :P2) as pv, ((:P1 - :P2) / ( (1+0.04) ^ 10 )) as fv;

query runs fine on DB - but on Wappler UI it throws error.

Please fix.

I don’t believe you can write SELECT clauses with :Parameters to define the field-names. I’ve certainly not had any success doing so.

You could try using SELECT {{asset_based_10_year_total}} for substitution instead - Wappler may do less preparing in such cases.

i see your point. have used vars on values in where clause in the past. but don’t recollect if we have done this on the filed computes. it should work ideally.
using {{}} is a unsafe approach (if not config very very carefully) coz it exposes to SQL injection risk.

Your call. Good luck

1 Like

Fixed in Wappler 5.2.0

1 Like

This topic was automatically closed after 32 hours. New replies are no longer allowed.