Editing a Stored Procedure

In this section:

Once you have created a procedure, you can open the text editor to view or revise it. The text editor provides sophisticated search and replace functions, code folding, and autocompletion options.

You can open a Master or Access File in the text editor by right-clicking the synonym on the file list and clicking Edit as Text (to edit the Master File) or Edit Access File as Text (to edit the Access File).

Some types of files open in ready-only mode in the text editor, such as when you open a Master File for viewing in Data Assist. In those situations, some text editor options are not available.

Tip: In addition to editing procedure code, you can copy, delete, or move a procedure component using options on the Applications resources tree or file list.

You can edit procedures from the Reporting Server browser interface or the Data Migrator desktop interface.

  1. Go to the the Reporting Server browser interface Applications page, or from the Data Migrator desktop interface, expand the Server node folder.
  2. Expand an application folder.
  3. Right-click a procedure, and select Open.

    The procedure opens in the text editor.

    Tip: Double-clicking the procedure will also open the text editor.

  4. When you have made your changes, click the Save, Save As, or Run icon.

Text Editor Menu Bar Functions

The text editor menu bar is shown in the following image.

The following functions are available.

Text Editor Color Coding

Certain syntax components in FOCEXECs and Master Files are color-coded in the text editor.

Searching for Text or a Regular Expression

Clicking Find (magnifying glass) on the menu bar opens the search panel. Clicking the plus sign (+) under the Search for text box opens the Replace section, as shown in the following image.

The following Find options are available.

The following image shows a regular expression search for the characters colon, left brace, and left bracket, with the focus on instance 2 of 40.

To close the Find function, click x at the right of the Search for row.

Configuring Text Editor Options

Pointing to the down arrow at the right end of the text editor menu bar and clicking Text Editor Options opens the Editor Options dialog box, as shown in the following image.

The following options are available. Click the check box next to an option to toggle the selection on and off.

When you have finished selecting the options you want, click OK.

Using Code Folding

When code folding is enabled, certain commands and syntax components that flow onto multiple lines can be rolled up so their content is hidden. Lines that can be folded display a down arrow to the left of the line, as shown in the following image.

The following image shows the same content with the DEFINE FILE command folded.

The arrow next to the DEFINE FILE command has changed to a right-facing arrow. Clicking it unfolds the command.

The following commands and characters can be folded.

Using Custom Folding

Custom folding enables you to choose the type of commands that you want to remain unfolded. This is especially useful when you open the Session Log, which contains all of the commands generated in your session.

To enable custom folding, click the down arrow on the text editor toolbar, and click Custom Folding....

The Custom Folding dialog box opens, as shown in the following image.

Check the boxes for the commands that you do not want to be folded. For example, DEFINE is checked for the following image that shows a file with comments, SET commands, a DEFINE command, and TABLE request.

If you previously implemented custom folding and want to remove it, click Remove Custom Folding. You can also unfold any folded text by clicking it.

Click OK.

Using Selection Folding

If you make selections in the editor and click the Selection Folding button, all lines that were not selected are hidden so that only the selected lines display. The following image shows selection folding after searching for occurrences of the characters LITE in the WF_RETAIL_LITE Master File.

This feature is useful when you make multiple non-contiguous selections, so that you can easily view all of your selections. The button toggles selection folding on and off, so that once selections are folded, you can click the button again to unfold them.

Text Editor Autocompletion

Autocompletion opens a list of supported keywords as you enter text in the Text Editor. Autocompletion is context sensitive. That is, it will only display keywords available in the portion of the syntax that has the focus. If you select a keyword, autocompletion does not parse the syntax to make sure it is correct.

You can enable autocompletion on an as requested basis (Ctrl+Space autocompletion) or whenever you are entering text where a keyword is available (live autocompletion).

The following image shows an autocompletion list within a GRAPH FILE command.

Click a keyword on the list to insert it into the syntax.

Using Tab Key Navigation

The text editor Tab key navigation supports Section 508 Accessibility Compliance by enabling users to navigate through the interface using the Tab key on the keyboard.

To implement Tab key navigation, either press the Esc key when in a file open in the text editor, or click the Tab Navigation button on the toolbar that is shown in the following image:

Once you have enabled Tab key navigation, the icon on the button becomes hollow in the center, as shown in the following image.

With Tab key navigation enabled, pressing Tab cycles between the features on the page.

Comparing or Merging Files

Using the server Compare Files and Merge Files options, you can compare or merge two files in the server text editor.

To compare or merge files, multi-select two files (by clicking one file, holding down the Ctrl key (or the Shift key if the files are contiguous) and clicking the second file), right-click, and select either Compare Files or Merge Files. Although both can show the differences, only Merge Files enables you to move content between the files. Compare Files is read-only.

Note: If the two files represent synonyms, selecting:

The files open in side-by-side panes. The differences are highlighted in light blue, with arrows indicating insertions and deletions. For Merge Files, the arrows let you copy lines between the files.

When the files first open, left and right scrolling is locked to the first difference, aligned in the middle of the window (when the file sizes allow), as shown in the following image for Merge Files.

If you click an arrow to copy a line from one file to the other, the highlighting and arrow disappear once the line is copied.

You can use the following buttons to move between differences and control the merge process. The arrows for the current difference will be aligned and displayed with left and right scrolling locked.

Button Image

Description

Save File (Merge only)

Each file has its own Save icon (Save Left and Save Right), so that you can save the file when you are finished with the merge edits for each.

Save File As (Merge only)

Each file has its own Save As icon (Save Left As and Save Right As), so that you can save the file in a new folder and/or under a new name when you are finished with the merge edits for each.

Jump to Previous Difference

Locks and aligns the left and right scroll bars to the previous difference, if there is one.

Jump to Next Difference

Locks and aligns the left and right scroll bars to the next difference, if there is one.

Undo (Merge Only)

Undoes the previous merge action.

Redo (Merge Only)

Redoes the previously undone merge action.