# Enable Disable Named Query Binding

**URL:** <https://forum.inductiveautomation.com/t/enable-disable-named-query-binding/92966>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [July 9, 2024, 4:06pm UTC](https://forum.inductiveautomation.com/t/enable-disable-named-query-binding/92966 "2024-07-09T16:06:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 9, 2024, 4:06pm UTC](https://forum.inductiveautomation.com/t/enable-disable-named-query-binding/92966/1 "2024-07-09T16:06:42Z")

</div>

I have a named query binding, but I don't have a connection to the database at the moment. As a result, I get a binding error every second when I have the window open.

~~How can I disable this binding when it's not needed?~~

Actually, it seems like it's due to a faulted database connection.

I would like to be able to document the binding that should exist, if the database connection is valid. I would assume I would need to use a script and `system.db.runNamedQuery()` with a boolean to "enable" it?

How do I handle passing datetime data type variables to the named query with Python?

---

<div class="post-metadata">

**Author:** ![drojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drojas/32/3403_2.png) [@drojas](https://forum.inductiveautomation.com/u/drojas)\
**Post date:** [July 9, 2024, 5:05pm UTC](https://forum.inductiveautomation.com/t/enable-disable-named-query-binding/92966/2 "2024-07-09T17:05:50Z")

</div>

Not sure if I understand what you are looking for, but named query bindings have an "Enabled" option. But, if you are doing scripting and want to ensure the database connection is faulted or not, look at the `System/Gateway/Database/<yourDBproviderName>/Available` boolean tag

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/3/83e258cf247f91095f2fd16c8bce183a04fa8c45.png)

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 9, 2024, 5:08pm UTC](https://forum.inductiveautomation.com/t/enable-disable-named-query-binding/92966/3 "2024-07-09T17:08:08Z")

</div>

The named query does not have an enable/disable option. (8.1.35)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/52eb6e8a039a5eec50b29f0d0a61316eb16f8800.png)

---

<div class="post-metadata">

**Author:** ![drojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drojas/32/3403_2.png) [@drojas](https://forum.inductiveautomation.com/u/drojas)\
**Post date:** [July 9, 2024, 5:10pm UTC](https://forum.inductiveautomation.com/t/enable-disable-named-query-binding/92966/4 "2024-07-09T17:10:09Z")

</div>

Oops, sorry, didn't see that you flagged this as Vision instead of Perspective.

Haven't had to worry too much with the case where the database connection comes and goes. I expect it to be as reliable of a connection as I would the Ignition server being up. If you are trying to query remote databases across a WAN...I don't recommend it for performance reasons.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 9, 2024, 5:37pm UTC](https://forum.inductiveautomation.com/t/enable-disable-named-query-binding/92966/5 "2024-07-09T17:37:48Z")

</div>

It's just part of a standard template I'm developing. Not all installations will have the DB connection. So it won't come and go, it'll either be there or not. I've just added a custom property bound to the database connection's "Available" tag.
