Code Complete

From RapidSQL
Jump to: navigation, search

Go Up to Automated Error Detection and Coding Aid Features

Code Complete lets you quickly and accurately write DML and call\execute statements by providing a fast and intuitive lookup for database objects. Code Complete lets you select from a suggestion box that lists objects appropriate at the cursor location within a statement. Code Complete offers intelligent suggestions in providing simple object names or in constructing fully-qualified names.

at16c752.jpg

This feature becomes available at all points in INSERT, UPDATE, DELETE, SELECT, CALL, and EXEC statements, including all legal clauses, where a reference to the name of one of the following object types is valid:

  • Columns
  • Tables
  • Views
  • Functions
  • Procedures
  • Packages
  • Synonyms

Before using the Code Complete feature, complete the following setup tasks:

  • Ensure that the object types for which Code Complete is to be available, are being indexed in the datasource index. For details, see ISQL Options - Code Assist - Advanced Tab.
  • By default, Code Complete is enabled and configured for automatic invocation. For information on enabling or disabling this feature and configuring auto-activation and other Code Complete preferences, see ISQL Options - Code Assist Tab.

When the Code Complete feature is enabled, it can be invoked in two ways:

  • Automatically, if auto-activation is enabled. A Code Complete suggestion box is offered when you start typing an object name in a relevant location and then stop typing for an interval that exceeds the specified auto-activation delay.
  • Manually, if auto-activation is disabled or if the specified auto-activation delay is sufficiently large, by pressing CONTROL+SPACE. or typing a period (.).
Note: By default, Code Complete is enabled and configured for automatic invocation. For information on enabling or disabling this feature and configuring auto-activation and other Code Complete preferences, see ISQL Options - Code Assist Tab.

Code Complete offers context sensitive suggestions based on the cursor location within the statement when Code Complete is invoked. For example:

  • When invoked without any preceding text - Code Complete will supply basic suggestions appropriate to that clause.
For example, suggestions for the table name in a FROM clause would help a user construct a qualified table or view name. Against a SQL Server datasource for example, this would include schemas and databases.

at16c771.jpg::

Suggestions for the column name in a WHERE clause in the same statement would contain the schemas, databases and tables\views referenced in the FROM clause as well as a listing of the applicable columns based on the referenced tables\views.

at16c776.jpg::

  • After the delimiter within an object name - Code Complete offers a list that lets you select the next element to build a fully qualified object name.

at16c77b.jpg::

  • After typing one or more characters of an object name - Code Complete offers a listing of the names of all object name elements, relevant to the cursor location within the object name, that start with the typed characters.

at16c780.jpg::

  • At any point within a partially-specified or complete object name - Code Complete offers all selections appropriate to the location of the cursor.

at16c785.jpg::

at16c789.jpg::

at16c78d.jpg::

In addition, you can type additional characters while the suggestion list is available to further filter the items appearing in the list.

To insert or replace a suggestion:

  1. Double-click an object name or object name element in the list. Alternatively, you can use the arrow keys and press ENTER.

To dismiss the suggestion list without making a selection:

  1. Click anywhere outside the suggestion list or press ESC.
Note: The schema information obtained to implement this feature can be outdated by the actions of other users or applications during an ISQL editor session. For information on refreshing this information, see ISQL Options - Code Assist Tab.