LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
CRoche

SQL Command Query for Database Toolkit

Status: New

I would like to see a tool in which you can actively see outgoing SQL queries as they are generated by the program.

 

While attempting to troubleshoot one of my programs in which I was pulling and updating data from a database, I had no way to confirm that the queries I was sending out had the correct syntax.  The error message I was receiving indicated there was a syntax error, but it was a little difficult to confirm where the issue was, or if really was a syntax issue at all.  Being able to see a string of the actual query would help a lot for troubleshooting programs that generate queries dynamically.

5 Comments
AristosQueue (NI)
NI Employee (retired)

Hm... that sounds like an excellent addition to the Desktop Trace Toolkit, which tracks all sorts of other aspects of your running VIs. I'll pass this idea along to the developers and see what they think.

Knight of NI

In the meantime, you could also accomplish this through the database server's profiler tools. For example, SQL Server 2000 comes with SQL Profiler. Newer versions don't, but I have seen replacement programs out there.

Wart
Member

Is there no way to add an output to the execute query VI that shows the actual query that was sent?  You'd have to open the select/update/insert/etc VIs to probe it, but that's where I always hunt first when I want to see the actual query.

 

Even if it ends up in the Desktop Trace Toolkit it would be a valuable addition.

JCC_(SK)
Active Participant

I thing that when you using SQL DB you should use Stored Procedures implemented on DB server and not to create you own SQL commands in your code. This approach will separate DB part and LV code part.

SteveChandler
Trusted Enthusiast

In the meantime you can do something that you should never do - modify the toolkit. I once modified the execute vi by wiring the SQL string to a named queue. I had another vi dequeueing that and writing to a log file.

 

But that was a long time ago and now I am my own db admin. It is much better to monitor the commands on the server if possible as smercurio_fc says if you have that option.

 

[Edit: If you have the DETT it would be better to wire to Generate User-Defined Trace Event than to use a queue]

=====================
LabVIEW 2012