Find tool not finding database references?

I've inherited a project, and it has a database connection. In status, I can see that it is in fact getting queries, albeit quite slowly (less than one transaction per second.) However, when I try to use the Find tool to see where the queries are coming from, it comes up with nothing. I'm supposed to update a 7.9.x gateway to 8.1.45. I've tried Find on both. What could I be missing? How can I find where these queries are? Any help would be greatly appreciated. Thanks.

Vision windows/templates are not fully searched, unfortunately, unless they're actually already open in the designer (despite what the open/all windows dropdown might lead you to believe). This is for complicated to explain legacy baggage reasons.

For this kind of problem, I've always found it easiest to have the database itself log the queries it is processing.

@pturmel While that's a good idea, it doesn't help me find where they're coming from.

@PGriffith Thanks. I'm trying that now. Unfortunately, since I'm doing this in an offline project that doesn't have access to the database, I'm getting so many errors per second that I can't get the Find dialog up with more than a couple of windows open, so I guess I have to go through them one at a time.

??

Most parts of Ignition have very specific query structures that show up clearly in DB logs. Knowing what is being queried often leads to the source.

For Vision, consider setting the project storage mode to XML instead of auto or binary, and opening then saving every window and template. You can then use grep in your gateway filesystem to locate suspicious SQL or NQ names.

Thanks. This is definitely the kind of thing I want. Unfortunately, I went through one whole project and found nothing. There are 3 others, but I thought they were nearly identical. Actually, there are also 2 more projects that look like they were temporary projects someone was trying something out on, rather than something running on clients. But I guess I'm going to do a lot of open, close, save, lather, rinse, repeat.

Are you sure it is coming from a project? Query tags, perhaps? Or runScript() running system.db.* ?

There are some query tags, but again Find didn't show any pointed at that database. I checked the gateway scripts and didn't see anything. I did, however, figure out that I'm dumb. The database I'm looking for is actually the default; I thought the default was a different database. So now it's anything on any window, and I can't search for the database connection name, because everything is just using default. Further, everything is using createSProcCall and execSProcCall, so searching for "SELECT " wasn't finding anything. At any rate, I appreciate all the help. Being able to grep the xml files was definitely key. (Actually, Select-String in Powershell, because I'm on Windows.)

1 Like

My condolences.