SQL エディター機能

www.altova.com このトピックを印刷 前のページ 1つ上のレベル 次のページ

ホーム >  SQL との作業 >

SQL エディター機能

The SQL エディター has multiple visual aids to make the display, editing and navigation of text easier. These include:

 

Line numbers
Syntax coloring
SQL statement selection and navigation
Bookmarks
Regions
Source folding
End-of-Line and whitespace markers
Zooming
テキストを折り返す
Text highlighting

 

Where applicable, you can toggle or customize the features above from the 「テキストビュー設定」 ダイアログボックス. Settings in the 「テキストビュー設定」 ダイアログボックス apply to the entire application—not only to the active document.

ds_dlg_text_view_settings

「テキストビュー設定」 ダイアログボックス

To open the 「テキストビュー設定」 ダイアログボックス, 次のいずれかを実行してください:

 

On the SQL エディター menu, select 「テキストビュー設定」.
Right-click the SQL エディター, and select 「テキストビュー設定」 をコンテキストメニューから選択します。

 

Some of the navigation or viewing aids can also be toggled from the application menu, toolbars, or キーボードショートカット. For reference to all applicable shortcuts, see the "Key Map" section of the 「テキストビュー設定」 ダイアログボックス illustrated above.

 

Line numbers

Line numbers are displayed in the line numbers margin, which can be toggled on and off in the 「テキストビュー設定」 ダイアログボックス. When a section of text is collapsed, the line numbers of the collapsed text are also hidden.

 

Syntax coloring

Syntax coloring is applied according to the semantic value of the text. You can enable or disable syntax coloring from the 「ツール | オプション」 menu, SQL エディター group.

 

Statement selection and navigation

The following buttons in the SQL エディター ツールバー allow you to select text, depending on where the cursor is positioned.

 

ic_next-stmt

Next statement (Alt+Down): Selects the statement after the statement where the cursor is currently located.

ic_previous-stmt

Previous statement (Alt+Up): Selects the statement before the statement where the cursor is currently located.

ic_last-stmt

Last statement (Alt+End): Selects the last statement in the SQL エディター.

ic_first-stmt

First statement (Alt+Home): Selects the first statement in the SQL エディター.

ic_select-entire-stmt

Current statement (Shift+Alt+Enter): Selects the statement where the cursor is currently located. または、you can also triple-click into a statement or click into any of the margins, if visible.

 

Bookmarks

Lines in the document can be bookmarked for quick reference and access. If the bookmarks margin is toggled on, bookmarks are displayed in the bookmarks margin.

ds_bookmarks_01

Otherwise, bookmarked lines are highlighted in cyan.

ds_bookmarks_02

The bookmarks margin can be toggled on or off in the 「テキストビュー設定」 ダイアログボックス.

 

You can edit and navigate bookmarks using the following commands:

 

ic_bookmark

ブックマークの挿入/削除

ic_next_bookmark

Go to Next Bookmark

ic_prev_bookmark

Go to Previous Bookmark

ic_rmv_all_bookmarks

Delete All Bookmarks

 

The commands above are available in the SQL エディター | Bookmarks menu and the SQL エディター ツールバー. Bookmark commands are also available through コンテキストメニュー, when you right-click the SQL エディター.

 

Regions

SQL エディター内で、 regions are sections of text that you mark and declare as a unit to structure your SQL scripts. The benefit of regions is that their enclosed text can be easily collapsed or expanded, and thus simplify navigation in long scripts (次も参照してください: "Source folding" below). It is also possible to nest regions within other regions.

 

 

To create a region:

1.SQL エディター内で、 select the statements you want to make into a region.
2.Click the Add Region ic_insert-region ボタン in the SQL Script ツールバー or select メニューオプション SQL エディター | Insert Region.

ds_sql_region

 

To remove a region:

Delete the -- region and -- endregion comments.

 

Source folding

Source folding refers to the ability to expand and collapse regions and is displayed in the source folding margin. The margin can be toggled on and off in the 「テキストビュー設定」 ダイアログボックス. To expand or collapse portions of text, click the "+" and "-" nodes at the left side of the window. Any portions of collapsed code are displayed with an ellipsis symbol. To preview the collapsed code without expanding it, move the mouse cursor over the ellipsis. This opens a tooltip that displays the code being previewed, as shown in the image below. Note that, if the previewed text is too big to fit in the tooltip, an additional ellipsis appears at the end of the tooltip.

ds_sql_region_collapse

The Toggle All Folds ic_toggle-all-folds command toggles all regions to their expanded or collapsed forms.

 

End-of-line markers, whitespace markers

End-of-line (EOL) markers and whitespace markers can be toggled on in the 「テキストビュー設定」 ダイアログボックス. The image below shows a document where both end-of-line and whitespace markers are visible. An arrow represents a tab character, a "CR" is a carriage return, and a dot represents a space character.

ds_markers

 

Zooming in and out

You can zoom in and out by scrolling (with the scroll-wheel of the mouse) while holding the Ctrl key pressed. または、press the "-" or "+" keys while holding the Ctrl key pressed.

 

テキストを折り返す

To toggle テキストを折り返す in the currently active document, select the SQL エディター | テキストを折り返す メニューコマンド, or click the テキストを折り返す ic_wrap ツールバー ボタンをクリックします。

 

Text highlighting

When you select text, all matches in the document of the text selection that you make are highlighted automatically. The selection is highlighted in pale blue, and matches are highlighted in pale orange. The selection and its matches are indicated in the scroll bar by gray marker-squares. The current cursor position is given by the blue cursor-marker in the scroll bar.

 

To switch text highlighting on, select Enable auto-highlighting in the 「テキストビュー設定」 ダイアログボックス. A selection can be defined to be an entire word or a fixed number of characters. You can also specify whether casing should be taken into account or not.

 

For a character selection, you can specify the minimum number of characters that must match, starting from the first character in the selection. 例えば、 you can choose to match two or more characters. In this case, one-character selections will not be matched, but a selection consisting of two or more characters will be matched. So, in this case, if you select t, then no matches will be shown; selecting ty will show all ty matches; selecting typ will show all typ matches; and so on.


(C) 2019 Altova GmbH