Named Query Switch

I wasn’t sure of the best title for this question, but here’s my issue…

In Vision I would have a power table and based on the result of a dropdown I would create a query string, then use this string in the SQL binding. I’m sure that’s all kinds of wrong, but that’s how I did it. With Perspective, and using named queries in general, what would be the best approach to this, short of stacking tables and using visibility?

The differences in the queries were substantial, returning different columns, different where clause, etc.

You can always use a script to fire different named queries. Or, you can use the (unsafe, technically) query string parameter type and do the exact same thing that a Vision query binding could do.

You’re talking about…

system.db.runNamedQuery("myUpdateQuery", params)

Forgot about that, thanks.

2 Likes