Ignition Dynamic Named Queries

I have a few questions surrounding named queries and database connections.

When creating a named query you specify a database to run the query against. Is there a way to make dynamic named queries where the database can be a parameter passed in as a parameter similar to how it can be done with scripting?

For database connections made in the gateway, is there a way I can get connection status and also potentially read the database connection configurations to display in perspective? I’d like a user to be able to select a configured database connection from the client app so queries can be dynamic between databases.

The tags in the folder [System]Gateway/Database contain some information.

You can use system.db.getConnections and system.db.getConnectionInfo to get info about connections as well.

I don’t know about the parameterized named queries.

Yes:
image

7 Likes

Awesome, I should have checked that out first. Thanks for the quick response!

Thanks this is exactly what I was looking for!