plsql common shortcut keys

 plsql usage skills

1. SQL PLUS-like window: File->New->Command Window, which is similar to oracle's client tool sql plus, but much easier to use.

2. Set the keyword to automatically capitalize: Tools->Preferences->Editor, select the Keyword case as Uppercase. In this way, when you enter a sql statement in the window, the keywords will be automatically capitalized, while others are lowercase. In this way, it is easier to read the code and maintain a good coding style. Similarly, in Tools->Preferences->Code Assistant (assistant), you can set the code prompt delay time, prompt when entering a few characters, and uppercase and lowercase database objects. capitalization, etc.;

3. View the execution plan: Select the SQL statement to be analyzed, and then click the Explain plan button (that is, the execution plan) on the toolbar, or press F5 directly; this is mainly used to analyze the execution efficiency of the SQL statement and the structure of the table, which is convenient for sql Provide an intuitive basis for tuning;

4. 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 Duplicate SQL statements.

Setting method: menu Tools–>Preferences–>Editor–>AutoReplace (automatic replacement)–>Edit

1), create a text file shortcuts.txt, and write the following content:
s=SELECT
copy the code and save it to the ~/PlugIns directory under the installation path of PL/SQL Developer
2), Tools–>Preferences–>User Interface– >Editor->AutoReplace, select the Enable checkbox, then browse the file to select the shortcuts.txt created earlier, and click Apply.
3) Restart PL/SQL Developer, enter s+space in the sql window, and sc+space to test.
Note: shortcuts.txt cannot be deleted, otherwise the shortcut keys cannot be used

Some rules are defined below for reference
i=INSERT
u=UPDATE
s=SELECT
f=FROM
w=WHERE
o=ORDER BY
d=DELETE
df=DELETE FROM
sf=SELECT * FROM
sc=SELECT COUNT(*) FROM
sfu=SELECT * FROM FOR UPDATE
cor=CREATE OR REPLACE
p=PROCEDURE
fn=FUNCTION
t=TIGGER
v=VIEW
sso=SET serveroutput ON;

Set shortcut keys (setting method: Menu Tools->Preferences->User Interface->Key Configuration)
New sql window: ctrl+shift+s
New command window: ctrl+shift+c
New test window: ctrl+shift+t
PL/ SQL Developer Beautifier: ctrl+shift+f
Redo: ctrl+shift+z
Undo: ctrl+z
Clear: ctrl+d (Use with caution, not recoverable, I am disabled O(∩_∩)O~)
Select all : ctrl+a
Indent: tab
Unindent: shift+tab
Uppercase: ctrl+shift+x
Lowercase: ctrl+shift+y
Comment: ctrl+h
Uncomment: ctrl+m
Find: ctrl+f
Show table structure: ctrl+ Hover over the table name
Template list: shift+alt+r
Window list: ctrl+w

5. Execute a single SQL statement: press the F8 key

6. TNS Names: menu Help->Support Info (support information)->TNS Names, you can view Oracle's tnsnames.ora;

7. 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:
1) First, select Procedures in the Browser on the left side of PL/SQL Developer , find the stored procedure that needs to be called;
2) Then, select the stored procedure to be debugged, right-click, select Test, in the pop-up Test script window, for the parameter defined as in type, you need to enter a value for the Value of the parameter ; Finally click the number button above: Start debugger or press F9;
3), Last click: RUN or Ctrl+R.

Debugging shortcut keys
Switch breakpoints: ctrl+b
Start: f9
Run: ctrl+r
Step into: ctrl+n
Step over: ctrl+o
Step out: ctrl+t
Run to exception: ctrl+y

8. Template shortcut keys

9. My Objects is automatically selected by default after login  

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 after selecting My Objects, the response rate is calculated in milliseconds of.

Setting method:
Tools menu -> Brower Filters, the order window of Brower Folders will be opened, and "My Objects" can be set as the default.
In the Tools menu -> Brower Folders, move the directories you often click (for example: Tables Views Seq Functions Procedures) a little higher, and add color distinctions, so that your average time to find tables will be greatly shortened, try it out.

Priority, from left to right
Tables–>Tablespaces–>Procedures–>Users–>Roles

1. SQL PLUS-like window: File->New->Command Window, which is similar to oracle's client tool sql plus, but much easier to use.

2. Set the keyword to automatically capitalize: Tools->Preferences->Editor, select the Keyword case as Uppercase. In this way, when you enter a sql statement in the window, the keywords will be automatically capitalized, while others are lowercase. In this way, it is easier to read the code and maintain a good coding style. Similarly, in Tools->Preferences->Code Assistant (assistant), you can set the code prompt delay time, prompt when entering a few characters, and uppercase and lowercase database objects. capitalization, etc.;

3. View the execution plan: Select the SQL statement to be analyzed, and then click the Explain plan button (that is, the execution plan) on the toolbar, or press F5 directly; this is mainly used to analyze the execution efficiency of the SQL statement and the structure of the table, which is convenient for sql Provide an intuitive basis for tuning;

4. 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 Duplicate SQL statements.

Setting method: menu Tools–>Preferences–>Editor–>AutoReplace (automatic replacement)–>Edit

1), create a text file shortcuts.txt, and write the following content:
s=SELECT
copy the code and save it to the ~/PlugIns directory under the installation path of PL/SQL Developer
2), Tools–>Preferences–>User Interface– >Editor->AutoReplace, select the Enable checkbox, then browse the file to select the shortcuts.txt created earlier, and click Apply.
3) Restart PL/SQL Developer, enter s+space in the sql window, and sc+space to test.
Note: shortcuts.txt cannot be deleted, otherwise the shortcut keys cannot be used

Some rules are defined below for reference
i=INSERT
u=UPDATE
s=SELECT
f=FROM
w=WHERE
o=ORDER BY
d=DELETE
df=DELETE FROM
sf=SELECT * FROM
sc=SELECT COUNT(*) FROM
sfu=SELECT * FROM FOR UPDATE
cor=CREATE OR REPLACE
p=PROCEDURE
fn=FUNCTION
t=TIGGER
v=VIEW
sso=SET serveroutput ON;

Set shortcut keys (setting method: Menu Tools->Preferences->User Interface->Key Configuration)
New sql window: ctrl+shift+s
New command window: ctrl+shift+c
New test window: ctrl+shift+t
PL/ SQL Developer Beautifier: ctrl+shift+f
Redo: ctrl+shift+z
Undo: ctrl+z
Clear: ctrl+d (Use with caution, not recoverable, I am disabled O(∩_∩)O~)
Select all : ctrl+a
Indent: tab
Unindent: shift+tab
Uppercase: ctrl+shift+x
Lowercase: ctrl+shift+y
Comment: ctrl+h
Uncomment: ctrl+m
Find: ctrl+f
Show table structure: ctrl+ Hover over the table name
Template list: shift+alt+r
Window list: ctrl+w

5. Execute a single SQL statement: press the F8 key

6. TNS Names: menu Help->Support Info (support information)->TNS Names, you can view Oracle's tnsnames.ora;

7. 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:
1) First, select Procedures in the Browser on the left side of PL/SQL Developer , find the stored procedure that needs to be called;
2) Then, select the stored procedure to be debugged, right-click, select Test, in the pop-up Test script window, for the parameter defined as in type, you need to enter a value for the Value of the parameter ; Finally click the number button above: Start debugger or press F9;
3), Last click: RUN or Ctrl+R.

Debugging shortcut keys
Switch breakpoints: ctrl+b
Start: f9
Run: ctrl+r
Step into: ctrl+n
Step over: ctrl+o
Step out: ctrl+t
Run to exception: ctrl+y

8. Template shortcut keys

9. My Objects is automatically selected by default after login  

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 after selecting My Objects, the response rate is calculated in milliseconds of.

Setting method:
Tools menu -> Brower Filters, the order window of Brower Folders will be opened, and "My Objects" can be set as the default.
In the Tools menu -> Brower Folders, move the directories you often click (for example: Tables Views Seq Functions Procedures) a little higher, and add color distinctions, so that your average time to find tables will be greatly shortened, try it out.

Priority, from left to right
Tables–>Tablespaces–>Procedures–>Users–>Roles

Guess you like

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