Editing Source Files

From SQLBrowser

Jump to: navigation, search

Contents

[edit] Opening SQL Files

There are 4 ways to open an SQL file for editing (in the worse-to-better order):

  • Use the File / Open Menu (quite slow, discouraged)
  • Find the file in the Operating System Explorer and Drag the file in the editor
  • Use the Favorites tab on the left to add Folders and Files (Right Click: Add to Favorites). If favorite tab is absent, make it appear in the Windows menu
  • Use the Find Object tab (Ctrl-Shift-O) and tick the 'Source' Option. (Need to setup the Sources Options in the preferences)
  • --> this is the most efficient way to open a source file

[edit] Editing SQL Files - Basic Actions

  • Use Alt-Ctrl-Shift-F to reformat the code
  • Use Tab or Shift-Tab on marked text to indent/unindent the marked block
  • Use Alt-Ctrl-K to comment a block
  • Use Ctrl-Click ob objects to jump to definition
  • Use Ctrl-Space or Ctrl-Tab for auto-completion. For auto completion of joins, please refer to Dependencies And Schema
  • You can use Templates to speed up code writing. For example, type crp <Tab> will expand a stored proc creation template. You can create you own templates in File / Option / Editor / Code Templates (Language:SQL)

[edit] Read-Only Analyzed Files

SQLBrowser displays SQL code in two kind of files:

  • Editable Files: this is what you obtain by opening an SQL file for editing.
Image:SQLBrowserScreenShot095.jpg
  • Parsed Files: This is the result of an Analysis. These fiels are read-only and presented in a yellowish background window. These 'parsed' objects have associated analysis in the form of Trees on the left hand side. Note that debugging can only happen on Parsed Files
Image:SQLBrowserScreenShot096.jpg

It is important to understand the distinction between these two kind of files

[edit] Version Control

It is strongly advised that SQL sources are placed under Version Control. To see how this works, hit F1 (General Help) and consult IDE Basics / Version Control and File History.

Personal tools