PLSQL usage skills (transfer)

If you want to do good things, you must first sharpen your tools. Recently, I have studied the use of various programming tools and discovered many new functions, which can greatly improve our daily work efficiency. The following is a reprinted PLSQL usage skill, personal feeling Very useful, please share.

1. PL/SQL Developer remembers the login password
  When using PL/SQL Developer, for the convenience of work, I hope PL/SQL Developer remembers the user name and password for logging in to Oracle;
setting method: PL/SQL Developer7.1.2 ->tools->Preferences ->Oracle->Logon History, "Store history" is checked by default, just check "Store with password", then log in again and enter the password once to remember.


2. Execute a single SQL statement
  When using the SQL Window of PL/SQL Developer, press the F8 key, PL/SQL Developer executes all SQL statements in the window by default, and needs to be set to the SQL statement where the mouse is located, that is, execute the current SQL Statement;
setting method: PL/SQL Developer7.1.2-->tools->Preferences-->Window types, check "AutoSelect Statement".


3. Formatting SQL statements
  When using the SQL Window of PL/SQL Developer, sometimes the input SQL statements are too long or too messy. I hope to use a more general writing format, so that it will look better and be easier to analyze. ;
How to use: Select the SQL statement to be formatted, and then click the PL/SQLbeautifier button on the toolbar.


4. Highlight the selected row
Preferences-->User Interface-->Editor-->other-->Highlight edit line


5. Double-click to display table data The default response when double-clicking a table or view with the
 mouse is really disappointing, because what I care about most is the table structure and data, but neither of these two things happened after double-clicking. Maybe the default response is what experts need, but for me, viewing data and table structure is the most important thing, and I don't care about other things. But the good thing is that this can be set, you can bind the required events to the mouse double-click and drag-and-drop, such as: double-click to edit data, drag-and-drop to display the table structure, Yeah!
 Setting method: menu Tools --> Preferences --> Browser, on the right, bind double-click and drag-and-drop operations for different Object Types.
  

6. All the characters
 of I think it is a good habit. The core of the information system is the database. When the system fails, the first thing to check is the SQL statement. How to quickly find the SQL statement in the vast log is a pain. thing. All-caps SQL statements won't solve this problem completely, but it's relatively easy to find a line of all-caps characters in the middle of a bunch of code, and your eyes will thank you.
Setting method: Menu Tools --> Preferences --> Editor --> Keyword Case --> Uppercase 7.  SQL statements written in SQL Window by

  
special Copy    usually need to be placed in Java or other languages, and need to be converted into
Add the corresponding hyphen to the string, this one thing does not need to be repeated, right-click on the written SQL, use the special Copy and that is OK!
 Setting method: Right mouse button --> Special Copy


8. Code auto-completion settings
Tools --> Preferences --> User Interface (Editor) --> Autoreplace --> enabled=true --> edit --> Enter the keyword you want to replace and save.


9. After logging in, My Objects is automatically selected by 
default. By default, after PLSQL Developer logs in, All objects will be selected in Brower. If the user you log in is dba, to expand the tables directory, it normally takes a few seconds to wait, but select My Objects The response rate after Objects is calculated in milliseconds.
Setting method:
Tools menu --> Brower Filters, the order window of Brower Folders will be opened, and "My Objects" can be set as the default.
Tools menu - Brower Folders, move several directories you often click (for example: Tables Views Seq Functions Procedures) a little higher, and add color distinctions, so that your average table search time will be greatly shortened, try it out .
 
  
10. Custom shortcut keys  
 There are many keys reserved in PLSQL Developer for users to customize, which is a very high thing. Unlike the overbearing Word, basically all the keys have predefined functions, and it is a headache to modify. Under normal circumstances, after opening PLSQL Developer, the most common thing is to open SQL Window and Command Window, and define shortcut keys for these two operations, ALT+S and ALT+C, so that three clicks with the mouse only need Press the key.
 Setting method: menu Tools --> Preferences --> Key Configuration
 

11. View the execution plan
  When using the SQL Window of PL/SQL Developer, sometimes the efficiency of the input SQL statement execution, analyze the structure of the table below, how to improve the efficiency of the query, you can check the execution plan provided by Oracle;
usage method: select the SQL to be analyzed statement, and then click the Explain plan button on the toolbar (that is, the execution plan), or simply press F5.


12. Debugging stored procedures
  When using PL/SQL Developer to operate Oracle, some stored procedures are sometimes called, or stored procedures are debugged;
the method of calling stored procedures: First, select Procedures in the Browser on the left of PL/SQL Developer, and find the required procedures. Called stored procedure; then, select the debugged stored procedure, right-click, select Test, in the pop-up Test scrīpt window, for the parameter defined as in type, you need to enter a value for the Value of the parameter; finally click the above bar Number buttons: Start debugger or press F9; last click: RUN or Ctrl+R.

 
13. Automatic replacement
Quickly enter SQL statements, such as input s, press space, and automatically replace with SELECT; for another example, enter sf, press space, and automatically replace with SELECT * FROM, which is very convenient and saves a lot of time to write repetitions SQL statement.
Setting method: menu Tools --> Preferences --> Editor --> AutoReplace. --> Edit
Some rules are defined below for reference
 s=SELECT
 f=FROM
 w=WHERE
 o=ORDER BY
 d=DELETE
 sf=SELECT * FROM
 df=DELETE FROM
 sc=SELECT COUNT(*) FROM

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326450915&siteId=291194637