Db tag binding to a sql query - can't specify the database?

How can we indicate the database to perform the sql select in the expression/binding of a db tag with the sql query mode ???

Right now you can only specify one database connection per SQLTags provider. That is why the database dropdown box is disabled. You can change the default database in the Ignition Gateway config section under SQLTags > Realtime by editing the default provider.

You can create multiple SQLTags (internal) providers that you can store separate tags in. Each provider can have a different default database associated with it.

Aha! That’s a piece I was missing in one of my back burner projects. I’d been getting around it by expressions and scripts, but this will help remove a few smoke and mirrors…

Does it have to be an internal provider?

No, it doesn’t have to be an internal one. You can also use the database driving provider.


A few things about this:

  1. In 7.3, you can now specify different database connections for expression tags in internal providers.

  2. You could always do this, by using “expression mode” instead of “sql mode”, and the expression functions “runScalarQuery”,“runUpdateQuery”, etc. Those functions look like “(query, [db connection])”.