Using the SQL Editor
When you initialize the editor, the following tabs are available:
-
Original
When editing an existing stored procedure, this tab displays the source code as it existed before your current session. This is useful for reverting to the original version of the code. -
Editing
The active source code of the stored procedure currently being modified. -
Query 1
Used for executing auxiliary SQL statements, such as testing the stored procedure. Additional tabs can be added by clicking the New Tab button.
Executing Statements
Clicking Execute runs the SQL code in the currently active tab. To execute only a specific portion of the script, select the desired text before clicking Execute. Results and any error messages are displayed in the results pane at the bottom of the page.
Multiple statements can be executed simultaneously by using a command delimiter. Use $$ for MySQL or GO for Microsoft SQL Server and SAP ASE.
Viewing Database Objects and Command Help
myDBR facilitates report development by providing quick access to object definitions and command documentation. To view the source code of a procedure or function, or to see a table's definition, highlight the object name and click Show Object. The information will open in a new tab.
Similarly, highlighting a myDBR command and clicking Show Object will display the relevant manual page, allowing you to quickly verify syntax and parameters.
Editor Preferences
To access editor settings, click the cog icon in the top right. Available preferences include:
-
Theme
Select a visual theme for the editor to customize its appearance. -
Indent with spaces
Specifies whether the Tab key inserts spaces or a tab character. -
Keymap
Select a keymap for the editor. Options include the standard keymap as well as Emacs, Sublime Text, and Vim. -
Autocomplete databases
Choose which databases should have autocomplete available.
Using Autocomplete
To use autocomplete, first select the desired databases in Editor Preferences. In the editor, begin typing an object or column name and press Ctrl+Space (Cmd+Space on Mac) to display suggestions.
Tip: You can keep the SQL Editor open in a separate window and run the report in another. This allows you to see changes immediately after refreshing the browser window.