Custom query has problems using @variables

OS info

  • Operating System : Windows 10.0.18363
  • Wappler Version : 3.7.6

Problem description

Attempting to use a SET @variable results in an error. This statement runs OK using a DB UI (Heidi in my case)

Steps to reproduce

  1. Create a custom query
  2. Type the text as shown in the attached picture
  3. See the resulting error

Many thanks,

This is not supported in Wappler custom query.
Probably use a stored procedure for this.

Thank you Sid.

Btw, I have two questions:

  1. This is out of curiosity: Why is that specific aspect of SQL not supported?
  2. This is to save us time in the future: How does one know what is and what is not supported in a Custom Query?

Many thanks,

Alex

I can answer this one from my understanding. @ or : are like reserved keyword for the Wappler custom builder UI to manage its custom parameters. And those are the same used in SQL. Internally, Wappler is just using SQL itself, so it just sets the parameters in a standard SQL manner.. without any custom logic.
Hence, same syntax cannot be used here.

As for second question, not sure if even Wappler team has tested all possible scenarios. Two that I can think of.. which don't work well with custom query and params are

  1. This one.. param variable in query
  2. IN clause and custom parameters