Difference between revisions of "WinSQL"
(→Easier Query Termination) |
(→Clear Recent Files List) |
||
| Line 38: | Line 38: | ||
Now close and re-open WinSQL. | Now close and re-open WinSQL. | ||
| + | |||
| + | = Better Comment Parsing = | ||
| + | |||
| + | The default way WinSQL handles comments is to pass them to the server, which is ridiculous and unnecessary. Anyone using T-SQL or MySQL might not experience issues, but Informix is the oddball that uses <i>curly braces</i> for comments, like <code>{ This is a comment. }</code> | ||
Revision as of 13:10, 13 March 2020
Easier Query Termination
I used to use a program called SqlDbx, which is free but it's only 32-bit unless you pay $300 for the paid version. When my workplace moved to Windows 10, I could no longer install the 32-bit Informix ODBC drivers, and so I could no longer use SqlDbx with Informix.
Moving over to WinSQL, I discovered a difference that annoyed me. In SqlDbx, I would write a sequence of queries that create temp tables, like this simplified example:
select id,
name,
sex
from employees
where sex = "F"
into temp employees_female with no log;
select id,
name,
sex
from employees_female
where name[0] = "A";
In SqlDbx, I could just run this whole thing exactly as I've written it. It runs the first query and creates the temp table, then the second query could select from the temp table. In WinSQL, it says the table "employees_female" is not in the database. It wasn't treating these as separate queries.
I discovered a simple solution:
- Go to the Edit menu and click Options.
- Under the General tab, there is a text field in the right pane called "Query terminator string". By default it is set to "go". Change it to ";" (semicolon).
- Uncheck the checkbox right underneath that which says "Terminators must be on a new line". Now click Ok.
So the default query terminator is "go," which makes sense I guess because that's common syntax in SQL Server, but I'm used to something more streamlined, and even our vendor's software uses queries terminated in the way I've written above, so this configuration change just makes it so much easier to work with thos queries, and it more streamlined.
Clear Recent Files List
In WinSQL go to File > "Open Data Folder..."
This opens C:\Users\username\AppData\Roaming\WinSQL in Explorer.
Delete the file RecentFiles.dat.
Now close and re-open WinSQL.
Better Comment Parsing
The default way WinSQL handles comments is to pass them to the server, which is ridiculous and unnecessary. Anyone using T-SQL or MySQL might not experience issues, but Informix is the oddball that uses curly braces for comments, like { This is a comment. }