[feature-1587]Dynamic Named Query Binding

Is it possible to build a named query path dynamically , like passing a parameter in the path string?
Except for scripting (will complicate the setup in this case, though that’s my last resort)
image

Not at present, although that’s an interesting idea :slight_smile:

Thanks. @PGriffith

I guess you need something like letting clients chose between two or three views?

Perhaps you can make custom dataset properties for the different named queries, and switch which dataset to link by using an expression.

This does mean that all named queries will be executed (even if they’re not visible). But if your query isn’t too heavy, this shouldn’t cause a problem, and will facilitate faster switching between the different views.

I would love to have this function. I need to swap syntax on my named queries based on SQL type (mariaDB/MSSQL)

You could have dynamic named queries through scripting easily.
system.db.getConnectionInfo() would be used to determine the projects DB.
Organize your Named Queries by DB Type.
image

Then change the named query path based on the db type returned by the system.db.getConnectionInfo()

First off, can i have that query you have there!! Guess the current result is +2years :frowning:

Yes, I do it that way myself at the moment. But I try to avoid scripting as much as possible, for ease of use for the end customer developers.

Seems like a trivial thing to insert a binding reference. (compared to other improvements)

1 Like

This is my struggle for every query:

1st transform:

2nd transform:
image

I will make shared scripts of this. But i feel like it creates alot of additional strain on the engine. (compared to an native binding method)

I’m also very interested in being able to dynamically build the named query path. The only way I can see to do what I want to do is to script execute the named query and then bind the resulting data to the data parameter of a table. It would be nice to be able to have some decision making ability and then just call the right query by having the path being bound.

It’s currently under review:
https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/dynamic-named-queries-in-perspective

1 Like