MyEclipse Database Tutorial: Editing and Executing SQL

  
in MyEclipse The Database Explorer tool includes an intelligent SQL editor. A SQL connection can be opened in the SQL editor to execute SQL statements and automate the execution of SQL-related fragments. In this tutorial, you will learn: Start and use SQL code completion functions to execute SQL statements to generate SQL queries and table creation scripts to change SQL command separators without MyEclipse? Xiaobian recommended "MyEclipse crack version download" 1. Enable SQL code completion function SQL code completion function requires pre-installed editor-related database metadata. By default, the SQL code completion feature is disabled to avoid serious performance issues because it can cause very large database metadata to be read or retrieved at very low bandwidth. This option can be activated if you prefer the code completion feature. (1) Select Window>Preferences, expand MyEclipse>Database Explorer, and select Performance Optimization. (2) Select Load all database metadata when the Connect checkbox is established, then click OK. Setting metadata loading options to enable code completion To optimize metadata retrieval, consider using a pattern filter. See Schema Filtering for more information. 2. Use the SQL code completion function (1) Select File>New>SQL File. Open a new SQL file in the editor (2) Select the new SQL file and file name you want to save in the project folder, then click Finish. Select the SQL file in the project folder (3) In the SQL editor, select the database connection you want the file association to. Note: This step requires the code to complete automatically and the fragment to execute normally. Linking the database to the SQL file Now you can enter the SQL statement and use code assist (Ctrl + Space) in each part of the SQL fragment, as shown below. Standard SQL syntax code helps code-assisted schema name code-assisted table name completion SQL statement hints: A useful SQL editor function is represented in the SQL editor of the synchronous database browser. In the editor, hold down the Ctrl key and select the table name at the same time. This location is on the database browser of the selected table. 3. Execute a SQL statement to execute the selected SQL statement fragment by clicking or pressing CTRL+F9. In this case, if the SQL statement is not selected, as shown in the example below, the SQL editor executes the entire edit text. The final query results are displayed in the result view of the SQL. Results of Query Execution 4. Using the SQL Generation Tool The Database Explorer tool provides two SQL generation tools, a table creation script generation and a sample SQL Query Builder. To generate a data definition language (DDL) for an existing table, right-click on the database browser in the table and select Generate>DDL. Note: Professional-level versions of users also have an advanced DDL generation feature when working with Oracle. Creating a Table Script A DDL script is generated when the selected table is recreated and will be displayed in the SQL Editor. The newly created table DDL script generates a sample SELECT statement in the table, right-click the table in the database browser, and select Generate>Select Statement. Generating a SQL SELECT statement from a table This generates a SELECT* statement and displays it in the SQL editor. New SELECT statement in SQL Editor 5. Change Command Delimiter The default command separator is a semicolon (;), which means that the semicolon is all SQL commands and query termination characters. However, in more complex scripts, semicolons are often used as internal delimiters and other strings are used as command delimiters. Such scripts do not work properly when the semicolon is a command delimiter. You can change the command separator by using the Cmd Sep drop-down list in the SQL editor. Choose from the existing settings of the splitter or enter your own type. Select a command separator Note: The drop-down list for Cmd Sep does not apply to the internal management of the Oracle Edit Parser. This article comes from [System Home] www.xp85.com
Copyright © Windows knowledge All Rights Reserved