Flexible Use of Pl/SQL skills

Source: Internet
Author: User

Pl/SQL tips flexible use 1.PL/ SQL Developer remember login password www.2cto.com when using PL/SQL Developer, for the convenience of work, it is hoped that PL/SQL Developer remember login Oracle username and password; setting Method: PL/SQL Developer 7.1.4-> tools-> Preferences-> Oracle-> Logon History. "Store history" is selected by default. Check "Store with password, remember to enter the password once you log on again. 2. Execute a single SQL statement when you use the SQL Window of PL/SQL Developer, press the F8 key. By default, PL/SQL Developer executes all SQL statements in the Window, the SQL statement where the mouse is located, that is, the current SQL statement is executed. Setting Method: PL/SQL Developer 7.1.4 --> tools-> Preferences --> Window types, check "AutoSelect Statement. Www.2cto.com 3. When formatting an SQL statement using the SQL Window of PL/SQL Developer, sometimes the entered SQL statement is too long or too messy, and you want to use a more common format to explain it, this will look better and better for analysis. Usage: select the SQL statement to be formatted, and then click the PL/SQL beautifier button on the toolbar. 4. using custom shortcuts PL/SQL Developer can also use custom shortcuts like other ides to improve coding efficiency and provide convenience for developers. For example, if we use the most frequent select * from statement in the SQL window, we can set a shortcut key to simplify the input of select * from statement. 12.16.create A shortcuts.txt file AND write the following content: reference s = SELECT * FROM w = WHERE 1 = 1 AND SC = SELECT count (*) FROM the installation path saved to PL/SQL Developer ~ \ PlugIns directory 2 ). tools --> Preferences --> User Interface --> Editor --> autoreplace, select the enableoption, select the created shortcuts.txt before the page view, and click Apply 3 ). restart PL/SQL Developer and enter s + space, w + space, SC + space in the SQL Window for testing. 4. view the execution plan when PL/SQL Developer uses the SQL Window, sometimes the efficiency of the input SQL statement execution, analysis of the table structure, how to improve the query efficiency, you can view the execution plan provided by Oracle; usage: select the SQL statement to be analyzed, click the Explain plan button on the toolbar, or press F5. Www.2cto.com 5. When you use PL/SQL Developer to operate Oracle, you can call some stored procedures or debug stored procedures. To call stored procedures, first, select Procedures in the Browser on the left of PL/SQL Developer to find the stored procedure to be called. Then, right-click the stored procedure to be debugged and choose Test, in the displayed Test scr limit pt window, for a parameter defined as in type, you need to enter a Value for the parameter Value. Finally, click the number button above: start debugger or press F9. Finally, click RUN or Ctrl + R 6 PL/SQL Developer to set the shortcut key. 1) After logon, My Objects is automatically selected by default. After PLSQL Developer logs on, in Brower, All objects will be selected. If the user you log on to is a dba, it will take several seconds to expand the tables directory. After selecting My Objects, the response speed is calculated in milliseconds. Setting Method: Tools menu --> Brower Filters. The order window of Brower Folders is opened and "My Objects" is set to the default one. Tools menu-Brower Folders: Move the directories you frequently clicked (for example, Tables Views Seq Functions Procedures) to a higher level and add colors to differentiate them, in this way, the average table searching time will be greatly shortened. Try again. 2) double-clicking displays the table data. double-clicking the table or view by default makes me feel disappointed, because I am most concerned with the table structure and data, however, these two events did not happen after double-clicking. The default response may be required by experts, but for me, viewing data and table structures is the most important thing, and I don't care about others. However, this can be set. You can double-click and drag and drop the mouse to bind the required event, for example, double-click to edit the data, drag and drop the display table structure, Yeah! Setting Method: choose Tools> Preferences> Browser to bind double-click and drag-and-drop operations to different Object types on the right. Www.2cto.com 3) It is a good habit to write SQL statement characters in uppercase. The core of the information system is the database. When a system goes wrong, the first query is the SQL statement, how to quickly find the SQL statement in the vast log is quite painful. SQL statements in uppercase cannot completely solve this problem, but it is easier to find a line of all uppercase characters in the middle of a pile of code. Thank you in your eyes. Setting Method: menu Tools> Preferences> Editor> Keyword Case> Uppercase 4) SQL statements written by special Copy in SQL Window usually need to be written in Java or other languages, you need to convert it into a string and add the corresponding connection characters. You do not need to repeat this task. Right-click the prepared SQL statement and use the special Copy function! Setting Method: Right click --> Special Copy 5) the custom shortcut key is reserved in PLSQL Developer for user customization. Unlike the domineering Word, basically all the keys have predefined functions, and it is a headache to modify them. Generally, after you open PLSQL Developer, the most common task is to open SQL Window and Command Window. The Shortcut Keys ALT + S and ALT + C are defined for these two operations, in this way, you only need to press the key to take the mouse three times. Setting Method: menu Tools --> Preferences --> Key Configuration 6) the SQL Window automatically selects the statement setting method based on the cursor position: Preferences --> Window Types --> SQL Window, select AutoSelect statement. Note: Each statement must be followed by a plus sign.

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.