Chat now with support
Chat with Support

Toad Data Point 5.0 - User Guide

Insert Code Snippets

Code snippets are segments of reusable code that you can easily insert into a SQL statement when working in the Editor. You can also use code snippets to:

  • Create custom code templates to ensure consistency in code development
  • Distribute code libraries to your development group

To insert a code snippet

  1. In the Editor, place the cursor where you want to insert the snippet, then do one of the following:

    • Double-click the snippet in the Code Snippets window.
    • Press CTRL+SPACE to select from a list of snippets (organized in folders by snippet type).
    • Drag the snippet from the Code Snippets window to the insertion point.

    Notes:

    • When using CTRL+SPACE to select from a list, as you expand the snippet treelist, the path displays in the Insert Snippet bar. You can use the path to navigate back to a folder in the path.
    • When using CTRL+SPACE to select from a list, click the snippet to view a description.
    • You can use incremental search to find a snippet or folder in the list by typing the first letters of the snippet or folder name.
  2. Enter the parameter values.

    Tip: Press TAB or SHIFT+TAB to navigate between parameters.

  3. Press ENTER to exit the snippet.

To insert a Surround With code snippet

Select the block of text to surround in the Editor and do one of the following:

  • Right-click and select Snippets | Surround with....
  • Double-click the snippet in the Code Snippets window.

To search for a code snippet

  1. Select View | Code Snippets from the menu . 

    Note: To search all snippets, right-click in the Code Snippets window and select Show All.

  2. Enter the name (or partial name) of the snippet or a keyword for the snippet in the Search field. Press ENTER.

Tips:

  • Press F1 immediately after inserting a snippet (while the snippet is still active) to open an online reference for that snippet, or select the snippet in the Code Snippets window and then click the online reference link in the bottom pane below the snippet description.
  • If you know the shortcut name for a snippet, enter the shortcut name and press CTRL+SPACE.

  • To insert a snippet saved in the Favorites or Shared Toad / Shared Snippets folders, press CTRL+N, and select the snippet. You can specify another name for your Favorites Folder in Tools | Options | Editor | Code Completion.

  • You can define a Shared Snippets Folder in Tools | Options | Environment | Network Share, to share snippets with colleagues. The Shared Snippets folder will replace the Shared Toad folder as the location for saved snippets when you select Add to shared folder when creating a snippet from the Editor.
  • Right-click a snippet in the Code Snippet window and select Open in New Editor to open a new Editor window that already contains the snippet.
  • To display all snippet folders in the Code Snippets window, right-click in the window and select Show All.
  • To display snippets for only the currently active open connection, right-click in the window and deselect Show All
  • See Advanced Analytics for more information about the Advanced Analytics code snippets.

 

Related Topics

Create Code Snippets 

About Editing SQL 

Advanced Analytics

Related Documents