Automated error detection and coding assistance

From RapidSQL
Jump to: navigation, search

Go Up to Session 3: Scripting

Rapid SQL provides a range of features that detect or help you avoid errors and save keystrokes in developing your scripts.

To enable these features:

  1. On the File menu, select Options. The Options dialog opens.
  2. In the left-hand pane, expand the ISQL node and then select Code Assist.
  3. On the Code Assist panel:
    • Ensure that Enable Code Complete is selected.
    • Ensure that Severity levels for semantic validation problems has Warning selected.
    • Ensure that Enable Real-time syntax checking is selected.
  4. Click OK.

To see these features in action:

  1. On the File menu, click New, and then SQL.
    Rapid SQL opens the SQL Editor window. You can add SQL code via your method of choice (free-form typing, retrieve from a file, paste copied code, etc.).
    af0f5caa.jpg
  2. Type SELECT * FROM and stop typing.
    Note the error condition.
    af0f5cb0.jpg
    Rapid SQL can run 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.
  3. 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.
    af0f5cb6.jpg
    Rapid SQL notifies you when a script contains a reference to an object that Rapid SQL cannot resolve.
  4. 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.
  5. Close the current SQL Editor window.

To restore Rapid SQL settings:

  1. On the File menu, select Options. The Options dialog opens.
  2. On the Code Assist panel, click the Restore defaults button.
  3. Click OK.

Proceed to Other coding aids.