Go Up to Session 5: SQL Management
DBArtisan offers a fully-featured SQL editor. In addition to basic text processing features, the editor environment offers testing/debugging and execution facilities. In combination with supporting features, the ISQL editor eases and speeds up the process of developing working scripts.
Automated error detection and coding assistance
DBArtisan provides a range of features that detect or help you avoid errors and save keystrokes in developing your scripts.
To enable these features:
- On the File menu select Options. The Options dialog opens.
- In the left-hand pane, expand the ISQL node and then select Code Assist.
- On the Code Assist panel:
- Ensure that Enable Code Complete is selected.
- Ensure that Enable Real-time syntax checking is selected.
- Ensure that Severity levels for semantic validation problems has Warning selected.
- Click OK.
To see these features in action:
- On the File menu, select New > ISQL.
- DBArtisan opens the ISQL Editor window. You can add SQL code via your method of choice (free-form typing, retrieve from a file, paste copied code, etc.).
- Experiment with the automated error detection and coding assistance as follows:
- Type SELECT * FROM and stop typing. Note the error condition.
- By default, DBArtisan runs a syntax check any time there is an interval of 1.5 seconds between keystrokes. You can also disable automatic syntax checking and only run a check when you manually initiate it. Syntax error annotation persists until you correct the problem.
- This time type a fragment that includes the name of a nonexistent object, SELECT * FROM NON.OBJECT, for example. For now, ignore any popups. The warning condition is a result of on-the-fly semantic validation. DBArtisan notifies you when a script contains a reference to an object that DBArtisan cannot resolve.
- Type SELECT * FROM followed by a space and then stop typing. If no popup appears, press CTRL+SPACE. The Code Complete suggestion box lets you select from objects or object name components such as databases or schema. This feature saves keystrokes and minimizes typing errors. See the online help for full descriptions of these features.
- If you want to disable the automated error detection and coding assistance features, select File > Options and on the Code Assist page, click Restore defaults.
The ISQL Editor window includes the following features and options:
- The ISQL window highlights all platform-specific and general keywords, and provides options for SQL code formatting and analysis.
- Once the code is executed, you have control over whether your transaction is committed or rolled back from the database.
- For all open ISQL windows, there are also options for connection locking, scheduling, executing your code across multiple datasources, explain plan generation, and SQL Tuning.
Setting environment options
DBArtisan lets you set platform-specific query options to immediately determine if your code is optimized.
- Press F8.
- Either close the Query Options dialog and then the SQL Editor window or enter a valid query in the ISQL editor and then execute your query by clicking the Execute button.
- When complete, ensure that only the Datasource Explorer window is open.
Proceed to SQL Debugging, Analysis and Tuning.