Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Object SuggestionSyntax/Example
Table

(TABLE) [catalog].[schema]

EMPLOYEE - (TABLE)HR

Alias Table

(TABLE ALIAS)

[catalog].[schema]tableName

EMPLOYEE - (TABLE ALIAS)HRJOBS

Column

datatype - (Column)

[catalog].[schema].tableName

JOB_TITLE:varchar(20) - (Column)HRJOBS

Alias Column

datatype - (COLUMN ALIAS)

[catalog].[schema].tableName.columnName

JOB_TITLE:int-(COLUMN ALIAS)HR.JOBS.JOB_ID

Schema

(SCHEMA) [catalog]

dbo-(SCHEMA)NorthWind

Catalog(CATALOG)
CallCall HR.ADD_JOB_HISTORY

Function Suggestions

Function SuggestionSyntax/Example
Built-inSELECT A FROM HR.DEPARTMENTS WHERE HR.DEPARTMENTS AVG
User-DefinedSELECT + FROM HR.CLIENTS WHERE HR.F_PERSONAL
Info

Function suggestions are only available for Oracle and DB2 platforms.

...

The following chart displays the possible statement fragments that SQL Editor will attempt to suggest/populate with objects:

Statement Fragment ElementsObject Suggestion Behavior
SELECT

A list of tables, when selected automatically, prompts the user to select a column.

UPDATE and DELETE

A list of tables appears in the FROM and/or WHERE clause.

INSERT

A list of tables and views appears in the INSERT INTO and OPEN BRACKET clause prior to values.

A list of columns based on the table or view name appears in the OPEN BRACKET or VALUES clause.

In addition to DML statements, SQL Editor also suggests objects based on specific fragmented syntax per line of code:

Statement SyntaxObject Suggestion Behavior
A partial DML statement (for example SEL ... indicates a fragment of the SELECT clause)

The keyword is completed automatically, assuming SQL Editor can match it. Otherwise, a list of suggested keywords is displayed.

If the preceding character is a period, and the word prior is a table or view, a list of columns appears.

If the word being typed is a part of a table name (denoted by a schema in front of it) the table name is autocompleted.

If the word being typed has a part of a column name (denoted by a table in front of it) the column name is autocompleted.

Without typing anything.

A list of keywords appears.

A period is typed.

If the word prior to the period is a name of a table or view, a list of columns is displayed.

If the word prior to the period is a schema name, a list of table names is displayed.

If the word prior to the period is either a table name or a schema name, then both a list of columns and a list of table names is displayed

To activate code suggestions:

...

Compare the parameters and formatted code in Example 2 with this example for a concept of how custom formatting works.

Custom Code Formatting ParameterValue (if applicable)

Stack commas separated by lists?

Yes

Stack Lists with __ or more items.

3

Indent Size?

2

Preceding commas?

Yes

Spaces after comma?

1

Trailing commas?

Spaces before comma?

Right align FROM and WHERE clauses with SELECT statement?

Yes

Align initial values for FROM and
WHERE clauses with SELECT list?

Yes

Place SQL keywords on their own line?

No

Indent size?

Indent batch blocks?

Yes

Number of new lines to insert

1

Indent Size

5

Right Margin?

80

Stacked parentheses when they contain multiple items?

No

Stacked parentheses when the list contains __ or more items.

_

Indent size?

5

New line after first parentheses?

No

Indent content of conditional and looping constructs?

Yes

Number of new lines to insert?

1

Indent size?

5

Image Modified
Custom Code Formatting Example 2

The following chart indicates a list of custom code formatting parameters and corresponding values. The chart is followed by the actual syntax as it would appear in SQL Editor based on the formatting parameter values. Compare the parameters and formatted code in Example 1 with this example for a concept of how custom formatting works.

Custom Code Formatting ParameterValue (if applicable)

Stack commas separated by lists?

Yes

Stack Lists with __ or more items.

2

Indent Size?

0

Preceding commas?

--

Spaces after comma?

Yes

Trailing commas?

Yes

Spaces before comma?

2

Right align FROM and WHERE clauses with SELECT statement?

No

Align initial values for FROM and
WHERE clauses with SELECT list?

--

...

Place SQL keywords on their own line?

Yes

Indent size?

4

Indent batch blocks?

No

Number of new lines to

...

insert

1

Indent

...

Size

5

Right Margin?

80

Stacked parentheses when they contain multiple items?

Yes

...

Stacked parentheses when the list contains __ or more items.

2

Indent

...

size?

2

New line after first parentheses?

Yes

Indent content of conditional and looping constructs?

--

Number of new lines to insert?

1

Indent size?

5

B'1=

...

ile.

...

sql

Begin

If x=S

...

SELECT

apple ,
pear ,
orange Big Orange' ,
strawberry ,
orchard name ,
owner

FR0M

fruit F ,
orchard 0

WHERE

fruit_region in

'latin america' ,
'f rance' ,
'russia' ,
'canada' ,

Anchor
_UNDERSTANDING_CODE_FOLDING
_UNDERSTANDING_CODE_FOLDING

...

Understanding Code Folding

SQL Editor features code folding that automatically sorts code into an outline-like structure within the editor window for easy navigation and clarity while developing code. 


The editor window automatically inserts collapsible nodes in the appropriate lines of code for organizational purposes. This enables you to expand and collapse statements, as needed, while developing code in particularly large or complicated files.

...