Came across a case where it would be handy to specify a user defined variable (%udv_xxxx%) in the "Execute SQL query" text box of the ODBC SQL test dialog.
I have 12 SQL servers where the query I want to run is identical on each machine. The query itself may change from time to time but it will always be identical for all 12 machines.
Thus, if I could define %udv_MyQuery% as "SELECT Count (*) ..." I would only have to change it in one location.
Not a huge deal - it might be tricky to distinguish between a UDV and a SQL text search pattern (i.e SELECT...WHERE somefield LIKE '%BOB%')
Ability to use User Defined Variables (udv) in ODBC SQL
Alex:
Aha. I discovered the problem. I was running 4.16 but what I was doing
was pressing the TEST button in the lower right corner of the "ODBC SQL Test" dialog.
Packet sniffer shows that when TEST button is pressed, the UDV name is being passed untranslated on port 1433 to the SQL server (i.e. "%udv_sqljoblogquery%" ).
However, if I save the test, then refresh, packet sniffer shows the translated UDV value is passed (i.e. "SELECT COUNT(*) ..."),
Thus the test works fine, but the 'test of the test' does not because the UDV is not being translated.
I don't know if this is a 'bug' per se, but thought I should pass it along....
Aha. I discovered the problem. I was running 4.16 but what I was doing
was pressing the TEST button in the lower right corner of the "ODBC SQL Test" dialog.
Packet sniffer shows that when TEST button is pressed, the UDV name is being passed untranslated on port 1433 to the SQL server (i.e. "%udv_sqljoblogquery%" ).
However, if I save the test, then refresh, packet sniffer shows the translated UDV value is passed (i.e. "SELECT COUNT(*) ..."),
Thus the test works fine, but the 'test of the test' does not because the UDV is not being translated.
I don't know if this is a 'bug' per se, but thought I should pass it along....
