Common Toad skills

Source: Internet
Author: User

I often use toad for SQL processing and system management. I have accumulated several common skills (based on toad9.5, previous versions may be different)

1. Automatic Configuration prompt. In the options, set the delay pop-up value. The default value is 1500. It can be set to 300 in milliseconds;

2. Set smart copy and paste. This function is often used to compile the front-end and back-end databases.ProgramIt can automatically convert the program SQL string on the clipboard into executable SQL statements according to the settings. In addition, you can also set, the SQL statements that have been formatted and debugged in Toad are automatically converted into SQL strings in the corresponding language. For details about the settings, see.

First, smart pasting

SQL = "Select count (*) as CNT"
  SQL = SQL & "From all_tables"
  SQL = SQL & "Where owner = 'Demo '"
  SQL = SQL & "And table_name = 'Employee '"

Paste it in Toad, select the pasted text, and press Ctrl + P to convert it into the following:

  Select Count (*) As CNT
  From All_tables
  Where Owner = 'Demo'
  And Table_name = 'Employee'

In settings, for Vb (you can set templates in different languages ):

% Sqlvar % = "% sqltext %"
% Sqlvar % = % sqlvar % & "% sqltextnext %"

Second, smart Replication

In toad, select the sorted SQL statement and use Ctrl + m to obtain the SQL string of the target language;

3. SQL Template

In the option Configuration window, select Editor-> behavior-> language-> PL/SQL-> edit. The preceding window is displayed. You can customize related templates here, use the shortcut key Ctrl + K in the editor to bring up the following interface:

When you press the subtitles in the red line, you can obtain the desired template step by step. When you press enter, the SQL statement corresponding to the Template Name is automatically filled in the current editor; alternatively, you can directly write the Template Name and then use the shortcut key to directly call the template. This operation is suitable for frequently-used templates. Otherwise, you can use the previous method to find the template;

4. Create your own predefined SQL statement

Toad can save the SQL statements used by the current user, and can call the history out with F8. In addition, it also allows the user to save and name frequently used SQL statements, the following describes the naming SQL statements.

Create named SQL

First, write the statement you want to save in the editor.

Then, select the last sub-menu in the Editor menu and add to named sqls

Call named SQL

Use Ctrl + N in the eidtor to bring up the named SQL list. Use the child-parent matching to find the desired SQL statement and press enter to automatically complete it;

5. Quick and Automatic completion

Do I frequently use select * from statements?

OK. Toad provides the automatic and quick replacement function. You only need to enter SF to see the above section. The specific settings are as follows:

 

6. view the execution plan

Select the SQL statement to view the execution plan, and press Ctrl + e to view

7. view the execution speed of the current SQL statement

In the destop panel, you can view the current SQL Execution speed through the query viewer. During the optimization process, you can see the modification history and the execution speed changes;

8. Auto trace

In the editor, right-click the menu and select Auto trace to view the tracing result after each query;

9. Script Execution

Unlike PL/SQL developer, toad can execute most of the scripts encountered by developers and management personnel in a window, and output relevant information about script execution through Script output. For queries, the corresponding shortcut key is Ctrl + enter or F9. For script execution, the shortcut key is F5;

During the query, I prefer Ctrl + enter. Because of this, I don't need to extend my hand to meet the special buttons above.

10. Object alias

This is also worth mentioning. In other editors, when a table alias is used for the second time, a problem occurs. The current table field is not displayed, it is the field of the table used for the first time. In toad, this can be effectively avoided. A can continue to be used, as long as a blank row is retained between different statement blocks;

11. xml formatting

During program debugging, the returned result is often XML. Toad is embedded with the XML formatting tool, which has the advantages, if there is a complete XML in the multi-line irrelevant characters, you do not need to manually remove irrelevant characters, as long as you directly press the format, the system automatically retains the desired XML, think about it, how useful this is ~~

12. Quick object viewing

In the editor, you only need to enter the table name or other object names (you can use Ctrl +. dynamic calling), and then press F4 to view the definition and implementation of tables, attempts, stored procedures, functions, and so on;

13. Object Browser

Object names can be filtered. This function is very valuable for large database maintenance.

 

14. More practical functions in the right-click menu

 

Let's get started with it ~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.