Once you have the SQLA all fired up, the next thing we want is to configure the settings. SQLA comes with some default settings that you might want to change. For example, every time you execute the query, you may want to preserve the previous ruleset. The default setting has a habit of closing the old ruleset.
In this recipe we will change the SQLA settings to better ones.
- Open SQLA.
- To change the behavior of the
resultset
, click on Tools | Options ..., highlighted in the following screenshot:
- From the pop-up window, click on the Query tab, as highlighted in the following screenshot:
- Next, uncheck the following boxes as shown in step 1; option 1will make sure that your old answer set is not closed when you are submitting your query. Tick the 7; option will help you execute highlighted queries when you have multiple queries in your window:
- There are many other options that, if you want, you can check and uncheck.
SQLA is a simple and efficient tool that helps users with their daily work. With better configuration, this tool can be used effectively.
SQLA also provides a way for you to automate your queries from a Windows machine. This recipe won't be covering the full process, but here are some commands that you can use to automate the scripts/jobs.
To execute SQLA from the command prompt, use the following:
Enter the following command on Run:
Sqla -c cookbook -f "c:\workbook\dbc.sql” -e "c:\workbook\resultset\dbc.log"
- The
-c
cookbook is used to establish a connection to the cookbook server -f "c:\workbook\dbc.sql"
opens a file in the given path directly to SQL Assistant-e "c:\workbook\resultset\dbc.log"
is used to export theresultset
to the given file
This will open SQLA, execute the queries, and close it afterwards. This is useful to schedule your jobs/queries on Windows machines.