I’m running a SQL query inside of a Calculated alarm notification roster and I have everything working properly EXCEPT I can only get it to work if I use an actual integer where “udt parameter here” is specified below.
data = system.db.runQuery("SELECT column_a FROM table_1 WHERE column_b = 3 AND column_c = *udt parameter here*", "DB")
for row in data:
builder.email([row["column_a"]]).add()
# use the builder object's build() function to create the finished list of data
userList = builder.build()
return userList
I’ve tried doing a read block:
faultqv = system.tag.read("[.]/LINES/PARAMS/LINES NUMBER")
fault = faultqv.value
Making the code:
data = system.db.runQuery("SELECT column_a FROM table_1 WHERE column_b = 3 AND column_c = 'fault' ", "DB")
for row in data:
builder.email([row["column_a"]]).add()
# use the builder object's build() function to create the finished list of data
userList = builder.build()
return userList
But that didn’t appear to work properly either.
What can I do to reference the tag value within the “runQuery”? I’m using 8.0.12