1. Right-click the menu
Right-click an object name in each text editing window in PL/SQL developer (PLD), such as SQL window, command window, And porgram window, A menu containing the operation object command is displayed, which is called the Right-click menu. For example:
Objects can be tables, views, synonyms, stored procedures, and functions. The pop-up menu varies depending on the object type. Tables and views include view, edit, rename, drop, query data, and edit data. View and edit are used to view and modify the structure information of a table, such as fields, primary keys, indexes, and constraints. Query data is equivalent to opening a new window and executing the select * from table. Edit data is equivalent to opening a new window and executing select * from table for update. Stored Procedures and functions have the test function. After selection, you can enter the debugging status.
Sometimes, due to PLD recognition errors, right-clicking an object does not produce a correct menu. You can add a semicolon before the DDL or DML statement of the object, in this way, PLD can correctly determine the object type.
2, select for update
Sometimes we need to import some data into the database. If we use the UE spelling insert statement, it will be troublesome and the operability is not strong. The SQL window of PLD allows you to query, add, modify, and delete table content. You can add, delete, and modify a query. You only need to add for update after the SELECT statement, lock the table row, and click the lock icon in the window to enter the editing status.
The following describes how to extract text from Excel and insert it into the database.
Our Excel file contains three columns:
Create a temporary table in the database:
Create Table T1 (cino varchar2 (100), contno varchar2 (100), loanno varchar2 (100 ))
Then, in the SQL window, enter select T1 for update and click the lock mouse to enter the editing status:
Click the input window of the first line. Then, the PLD will be deadlocked for several seconds. Then, you can see the cursor flashing in the input box of the first line. Click cino, contno, loanno and select:
In Excel, select the content to be inserted into the database, switch to PLD, and press Ctrl + V:
Click √, and then click the commit button. Then, the data is submitted to table T1. Run select * from T1 to see the following content:
3, PL/SQL beautifier
PLD 6 and later versions have DML CodeFormat. Select some code in SQL window or program window (if not selected, operate the code in the entire window), and select Edit à PL/SQL beautifier in the menu to get the formatted code. For invalid DML statements or DDL statements, PLD will prompt PL/SQL beautifier cocould not parse text in the following status bar.
By default, PLD will sort every field in the DML statement in a separate row, which is inconvenient to view. Select Edit à PL/SQL beautifier options from the menu to go to the preferences window. select Edit to go to the configuration file editing page:
Select DML in the label column, select fit in the select, insert, and update group boxes in the middle of the window, click save, save the configuration file to the PLD installation directory, and click Close. In rules file, enter the location of the configuration file and click OK to switch the configuration file. In this case, you can format the code so that each field is on a row as much as possible.
4. TNS names
Menu help à support info à TNS names, you can view the tnsnames. ora of oracle.
5. Copy to excel
Run the SELECT statement in the SQL window. After the result is displayed, right-click the data area below and select copy to excel to copy the records in the data area to the Excel file. But there are two points to note: first, the field cannot start with =; otherwise, Excel will mistakenly think of it as a function; second, the number should not exceed 17 digits; otherwise, the subsequent digits will be set to 0, however, you can add 'to the front of the number to make Excel think that the field is text. At the same time, it is best to use to_char to output numbe fields in the database. Otherwise, it may be abnormal.
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