Rapid SQL Developer User Guide
Rapid SQL Developer User Guide
1 User Guide
Copyright 1994-2009 Embarcadero Technologies, Inc. Embarcadero Technologies, Inc. 100 California Street, 12th Floor San Francisco, CA 94111 U.S.A. All rights reserved. All brands and product names are trademarks or registered trademarks of their respective owners. This software/documentation contains proprietary information of Embarcadero Technologies, Inc.; it is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited. If this software/documentation is delivered to a U.S. Government Agency of the Department of Defense, then it is delivered with Restricted Rights and the following legend is applicable: Restricted Rights Legend Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013, Rights in Technical Data and Computer Software (October 1988). If this software/documentation is delivered to a U.S. Government Agency not within the Department of Defense, then it is delivered with Restricted Rights, as defined in FAR 552.227-14, Rights in Data-General, including Alternate III (June 1987). Information in this document is subject to change without notice. Revisions may be issued to advise of such changes and additions. Embarcadero Technologies, Inc. does not warrant that this documentation is error-free.
Contents
Welcome to Rapid SQL Developer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Technical Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Rapid SQL Developer Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Using Rapid SQL Developer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Working with Data Sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Register Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Importing and Exporting Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Browse a Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 View Database Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Search for Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Filter Database Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Define Data Source-Specific Object Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Define Global Database Object Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Drop a Database Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Working with Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Create a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Open an Existing Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Search a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Add Files to a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Delete a Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Creating and Editing SQL Files (SQL Editor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Create an SQL File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Open an Existing SQL File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Working in SQL Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Understanding Automatic Error Detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Understanding Code Assist. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Understanding Hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Understanding Code Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Understanding Code Folding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Understanding Code Quality Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Understanding SQL Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 View Change History. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Revert to an Old Version of a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Delete an SQL File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Executing SQL Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Associate an SQL File with a Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
C O N TE N TS >
Configure an SQL Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Execute SQL Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 View and Save Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 View Log Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Maintain Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Filter Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Import and Export Error Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Find and Fix SQL Code Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Find and Fix Other Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Configuring Rapid SQL Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Initial Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Specify a Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 License Rapid SQL Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Customizing Rapid SQL Developer (Preferences) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Set Data Source Indexing Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Set SQL Editor Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Set SQL Execution Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Set Code Assist Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Set Code Formatter Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Set Results View Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Set Syntax Coloring Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Set SQL Filter Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Set SQL Code Template Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Set File Encoding Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Set Data Source Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 DBMS Connection Parameters by Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 IBM DB2 LUW. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 IBM DB2 z/OS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Microsoft SQL Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 JDBC Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Oracle Connection Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Sybase Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 InterBase Connection Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Firebird Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
Technical Requirements
Before installing Rapid SQL Developer, verify that your environment meets the following requirements. Hardware Requirements The following minimum hardware requirements are required to run Rapid SQL Developer: Pentium 4-Level Processor 512 MB of memory 500 MB of disk space 1024 x 768 screen resolution Operating System Requirements Rapid SQL Developer supports the following operating systems: Microsoft Windows XP, x86-32, Win32 Microsoft Vista, x86-32, Win32
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
WE L CO ME T O R AP I D S Q L D E V E L O P E R > TE C HN I C A L RE Q U I R E M E N TS
Microsoft Windows Server 2003 Linux, x86-32, GTK 2 Red Hat Enterprise Linux 5.0 SuSe Linux Enterprise Server 10 DBMS Support Rapid SQL Developer provides native support for the following platforms (no additional DBMS client software is required): IBM DB2 LUW (8.0 - 9.5) IBM DB2 z/OS (8.0 - 9.0) Interbase (2007, 2009) Microsoft SQL Server (2000, 2005, and 2008) Oracle (8i - 11g) Sybase ASE (12.5 - 15.0.2) Generic JDBC Installation Notes Rapid SQL Developer can be installed as a standalone application (RCP installation) or as an Eclipse plug-in (Plug-in Installation). Eclipse is an open source development framework that supports application plug-ins to provide additional functionality. The Eclipse plug-in version of Rapid SQL Developer requires Eclipse version 3.5 or higher, and Sun Java Standard Edition 5.0 Update 11 or later in addition to regular system requirements. Before installing the plug-in version of Rapid SQL Developer, ensure that Eclipse and Java is installed on your machine. You can download Eclipse from the following Web site: http://www.eclipse.org/downloads.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
R AP I D S Q L D E V E L O P E R O V E RV I E W > TE C H NI C A L R E Q U I R E M E N TS
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
Choose the type of data sources you want to scan for and click Next. The wizard automatically returns all data sources it finds on your machine based on the criteria you specified.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
Choose the data sources you want to add to the Rapid SQL Developer environment and click Finish. Data Source Explorer automatically populates with the new data source selections.
To add data sources manually, right-click Managed Data Sources in the Data Source Explorer tree, select New > Data Source, and enter the connectivity parameters as prompted. For additional information on data source connection parameters, see DBMS Connection Parameters by Platform. Once registered, the data source appears in the Data Source Explorer view. If you have created more than one workspace, they all share the same data source catalog. Once a data source has been registered, the connection parameters are stored locally. In some cases, a user ID and password are required to connect to a registered data source. Rapid SQL Developer can encrypt and save user IDs and passwords to connect automatically. Note: If you are experiencing difficulties with the import of data sources from other Embarcadero products, you can import the old data sources via your systems Windows registry by selecting File > Import... > Embarcadero > Data Sources > Previously Registered Embarcadero Data Sources (Registry). For more information on importing and exporting data sources, see Importing and Exporting Data Sources.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
10
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
The following types of sources can be imported to Data Source Explorer: Eclipse Data Tools Platform (DTP) Previously Registered Embarcadero Data Sources (File) Previously Registered Embarcadero Data Sources (Registry)
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
11
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
Quest Software (TOAD) Once a data source is registered, it automatically appears in Data Source Explorer. Connection parameters are stored locally, and Rapid SQL Developer can be set to connect automatically each time you select the data source from the tree. Conversely, you can also Export your current data source catalog to a file, which can then be imported into other instances of Rapid SQL Developer via the Previously Registered Embarcadero Data Sources (File) option. This is performed using the File > Export command in the Main Menu, and then selecting Embarcadero > Data Sources from the tree view in the Export Data Sources dialog. To import data sources: 1 2 3 Select File > Import. The Import Data Sources dialog appears. Choose Embarcadero > Data Sources from the tree and click Next. Choose a source from which you want to import the data sources. You can choose to import data sources from the DTP, TOAD, or an existing Embarcadero data source catalog stored in the Windows registry or as a file (created via the Export command). Click Next. Specify the location of the import source and click Finish. Data Source Explorer is automatically populated with the new data sources.
To export data sources: 1 2 3 4 5 Select File > Export. The Export Data Sources dialog appears. Choose Embarcadero > Data Sources from the export tree and click Next. Use the check boxes beside each listed data source to indicate which data sources you want to export. Click Next. Click Finish. The data sources are automatically exported in the form of an XML file. You can import this file to other instances of Rapid SQL Developer via the Import command.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
12
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
Rapid SQL Developer Object Properties are viewed via the Properties dialog. The dialog is accessed by right-clicking the object in Data Source Explorer.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
13
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
To view Data Source Explorer object properties: The Info properties node is accessed by right-clicking a data source in Data Source Explorer. The dialog displays the following three properties: Name: The name of the node as it appears in the Database Explorer. This value cannot be modified. Path: The folder path and file name where the object is stored on the system. This value cannot be modified. Type: The type of data source object that the node represents. For example, the Type value for a table node would be TABLE. This value cannot be modified. As well, each node representing the actual data source connection (the uppermost parent in a list of data source objects), contains additional properties in addition to the Info node and its respective properties. With the exception of the Configuration node, these values can be modified in the Properties dialog. The Configuration node is composed of: Data Source Name Data Source Type and three subnodes: Connection Information, Data Source Information, and Security Parameters. These nodes are identical to the parameters used to initially define the data source during the data source registration process. For more information on these values and how to modify them, see Register Data Sources. The SQL Filter node enables a developer to place filters on data source objects that appear in the Database Explorer. For more information, see Filter Database Objects.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
14
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
15
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
Click Search. The results of your search are generated in the Search view. When you open a matched file, references to the keyword are flagged with yellow arrow icons that appear in the left-hand column of the editor.
You can navigate between keywords within all returned files using the yellow up and down arrows that appear at the top of the Search view.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
16
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H D A TA S O U RC E S
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
17
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H P R O JE CTS
Specify the parameters of the filter template: In the Name field, enter the name of the filter as you want it to appear in the selection window on the SQL Filter node. The Database Type pane provides a list of data source objects. Deselect the data source objects that this template filters so that they do not appear in Database Explorer when displaying data source objects for the data source. Click New to add filter parameters for data source objects properties. The New SQL Filter Predicate dialog appears. Use the Property and Operator fields to supply the filter criteria. Property specifies whether the value is a Name or Schema, and Operator specifies the matching type of the filter syntax. (Equals, Not Equals, Like, Not Like, In, Not In) In the Value field, enter the full or partial syntax of the property or properties you want the template to filter in data source Explorer.
5 6
Click OK. The filter property specification is added to the Filter Template. When you have finished defining the filter template, click OK. The template name is added to the Properties dialog. It can be enabled and disabled by selecting or de-selecting the check box beside its name, respectively.
Data Source object filters are added and removed from the development environment by selecting and de-selecting the checkboxes associated with each filter template on both the global and data source-specific dialogs.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
18
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H P R O JE CTS
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
19
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H P R O JE CTS
Search a Project
1 2 Select Search > File. Specify the search criteria: Type the value to search in the Containing Text field. Use the * character to indicate wildcard string values, the ? character to indicate wildcard character values, and the \ character to indicate an escape character for literals (* ? /). Select Case Sensitive and indicate to the search function that it should take into account case when searching for appropriate string matches. Select Regular Expression to indicate to the search function that the string is a regular function. In the File Name Pattern field, specify the extension name of the files to search for explicitly. If the value in this field is a * character, the search function searches all files regardless of extension. Manually type in the extensions to indicate file type (separate multiple file types with commas), or click Choose and use the Select Types dialog to select the file extensions the process will search for the string by. Select Consider Derived Resources to include derived resources in the search. Select Workspace or Working Set to choose the scope of the search. If you choose Working Set, specify the name of the defined working set manually, or click Choose and navigate to the working set you want to search for in the provided string. 3 Click Search. The results of your search are generated in the Search view on the Workbench.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
20
U S I N G R A P I D S Q L D E V E L O P E R > WO R K I N G W I T H P R O JE CTS
To use the Import command: 1 2 Right-click anywhere on the Project Explorer and select Import. The Import dialog appears. Expand the General node and double-click File System. A dialog containing the import specification parameters appears. In the From directory field, manually type the directory location of the files you want to import to Project Explorer, or click Browse and navigate to the appropriate folder. The panels below the field populate with the folder selection and a list of suitable files contained in that folder. Use the check boxes beside each folder and file to specify what folders/files you want the import function to add in Project Explorer. In the Into folder field, manually type the name of the folder within Project Explorer where you want to import the files specified in the panels above, or click Browse and navigate to the appropriate folder. Select the Overwrite existing resources without warning check box if you do not want to be prompted when the import process overwrites Project Explorer files that contain the same name as the imported files. Choose Create complete folder structure or Create selected folders only, depending on whether you want the import process to build the folder structure of the imported directory automatically, or only create those folders you selected in the panels above, respectively. 3 Click Finish. The import process moves all selected folders and files into Project Explorer and thus into the Rapid SQL Developer development environment. NOTE: In addition to accessing the Import command via the shortcut menu, you can also access the Import dialog by choosing File > Import ... from the Main Menu.
Delete a Project
You can delete a project by right-clicking its folder in the SQL Project Explorer and selecting Delete. When you delete a project, Rapid SQL Developer will prompt you with a Confirm Project Delete dialog that asks you to confirm the deletion of the project, and offers you the option of deleting the project from the Rapid SQL Developer interface, or deleting the project from the system. If you select Do not delete contents, the files and directory structure will be removed from SQL Project Explorer, but they will still exist on your machine. If you select Also delete contents , the files and directory structure will be removed from SQL Project Explorer and deleted from your machine.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
21
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
SQL Editor contains context-sensitive command menus that are tailored with pertinent functionality for the specified file format. If SQL Editor does not recognize a selected file format, Rapid SQL Developer automatically launches the file externally in the system default application. External editors are not embedded in the Workbench. For example, on most machines, the default editor for HTML files is the system Web browser. SQL Editor does not, by default, recognize HTML files, and opening an HTML file from the Workbench launches the file in an instance of the Web browser instead of the Editor. Any number of instances of SQL Editor can be open on the Workbench at the same time. Multiple instances of SQL Editor displaying different content may be open in the same Workbench. These instances will be stacked by default, but can also be tiled side-by-side so the content of various files can be viewed simultaneously for comparison or multi-tasking purposes. When an instance of SQL Editor is active, the Workbench Main Menu automatically contains commands applicable to the file format. If a view is active, SQL Editor commands are disabled automatically, except when commands are still valid between the selected view and the file displayed in the interface. When working with code in SQL Editor, the window contains a number of features that provide an increase in the efficiency and accuracy of code development. The following syntax highlighting changes are automatically applied to code as a user adds lines in the interface.
Code
Comments SQL Commands Coding Errors
Formatting
Green font, italics Dark blue font Red underline
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
22
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Code
Strings Non-Executable Command Line Commands
Formatting
Red font Aqua font
Single line and multiple line comments appear in different colors. Furthermore, SQL Editor provides two column bars, one on either side of the code window. The purple change bar in the left-hand column indicates that the line of code has been modified. Hover over the change bar to display the original code text. The red square in the right-hand column indicates that there are errors in the code window. Hover the mouse over the square to view the error count. Click the red bar in this column to navigate directly to the line in which the SQL Editor detects the error. SQL Editor automatically highlights the appropriate code. Non-executable command line commands are displayed in a different formatting style than SQL commands. Syntactic and semantic errors are also highlighted. SQL Editor also features dynamic error detection, object lookup and suggestion features, code folding, and auto-formatting. SQL Editor is able to identify different areas in a statement, and enables users to retrieve subclauses, resolve table aliases, and dynamically return lists of tables, views, and columns, as needed. See also: Working in SQL Editor
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
23
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Any number of instances of SQL Editor can be active on the Workbench at the same time. Multiple instances of SQL Editor displaying different content may be active on the same Workbench. These instances will be stacked, by default, but can also be tiled side-by-side, so the content of various files can be view simultaneously for comparison or multi-tasking purposes. When an instance of SQL Editor is active, the Main Menu contains commands applicable to the file format. If a view is active, SQL Editor commands are disabled automatically, except when commands are still valid between the selected view and the file displayed in the interface.
Among the commands SQL Editor supports via the right-click menu: Revert File: Automatically restores the working file to the original text as it appeared the last time the Save command was issued. Shift Right/Shift Left: Indents the line of code in the working file to the right or left, respectively. Toggle Comments: Hides or displays comments in the code of the working file, depending on the current hide/show state. Add Block Comment/Remove Block Comment: A block comment is used to insert a comment into SQL code that spans multiple lines and begins with a forward slash and asterisk. While block comments are typically used to insert a command that spans multiple lines, some developers find them more useful than line comments, especially if a development team is using different text editors on an individual basis. Moving code from one text editor to another often breaks line comments in the middle of a line and causes errors. Block comments can be broken without causing errors. NOTE: In addition to editing commands, some commands such as extract, drop, and execute can be accessed by right-clicking over statements in SQL code that are performed on specific tables, views, and columns. These commands will appear automatically in the appropriate menu when the code is highlighted. Full information on using these commands is found elsewhere in this documentation, based on the task each executable performs.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
24
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Explain Plan: An explain plan details the steps that occur in SELECT, UPDATE, INSERT, and DELETE statements and is primarily used to determine the execution path followed by the database in its SQL execution. See also: Understanding Automatic Error Detection Understanding Code Assist Understanding Hyperlinks Understanding Code Formatting Understanding Code Folding Understanding Code Quality Checks Understanding SQL Templates
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
25
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Additionally, all semantic errors detected in SQL Editor are displayed in the Problems view.
Right-click the an error and select Go To in order to find the error. Rapid SQL Developer opens and navigates to the specific line of code containing the specified error. NOTE: Automatic error detection functions, such as syntax checking and semantic validation are suspended if #define or #include directives are detected in an editor window. Rapid SQL Developer does not perform #define/#include substitutions on execution.
Code assist is available for SELECT, UPDATE, INSERT, and DELETE statements, as well as stored procedures, and functions (built-in and user defined.) Additionally, code suggestions can be made for DML statements nestled within DDL statements. This functions in the same manner as code assist for statements that are not nestled, and applies to CREATE PROCEDURE, FUNCTION, TRIGGER, TABLE, and VIEW statements. When the code assist window is open, you can filter out singular object suggestions by pressing ( Ctrl + Spacebar). This removes all objects from the assist window while retaining procedures and functions. To display objects again, press ( Ctrl + Spacebar ) again. The following table displays a list of all possible object suggestions, and the format in which SQL Editor inserts the suggestions into a statement: Object and Stored Procedure Suggestions
Object Suggestion
Table
Syntax/Example
(TABLE) [catalog].[schema] EMPLOYEE - (TABLE)HR
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
26
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Object Suggestion
Alias Table
Syntax/Example
(TABLE ALIAS) [catalog].[schema]tableName EMPLOYEE-(TABLE ALIAS)HRJOBS
Column
Alias Column
Schema
Catalog Call
Function Suggestions
Function Suggestion
Built-in User-Defined
Syntax/Example
SELECT A FROM HR.DEPARTMENTS WHERE HR.DEPARTMENTS AVG SELECT + FROM HR.CLIENTS WHERE HR.F_PERSONAL
SQL Editor detects incomplete or erroneous code, processes the code fragments, and then attempts to apply the appropriate logic to populate the code. As code is typed into SQL Editor, the application reads the language and returns suggestions based on full or partial syntax input. Depending on the exact nature of the code, the automatic object suggestion feature behaves differently; this enables SQL Editor to provide reasonable and intelligent suggestions on coding. Additionally, semantic validations can be made for DML statements nestled within DDL statements. This functions in the same manner as validation for top-level statements, and applies to CREATE PROCEDURE, FUNCTION, TRIGGER, TABLE, and VIEW statements. The following chart displays the possible statement fragments that SQL Editor will attempt to suggest/populate with objects: Statement Fragment Elements
SELECT UPDATE and DELETE
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
27
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
In addition to DML statements, SQL Editor also suggests objects based on specific fragmented syntax per line of code: Statement Syntax
A partial DML statement (for example SEL ... indicates a fragment of the SELECT clause)
A list of keywords appears. If the word prior to the period is a name of a table or view, a list of columns is displayed. If the word prior to the period is a schema name, a list of table names is displayed. If the word prior to the period is either a table name or a schema name, then both a list of columns and a list of table names is displayed.
To activate code suggestions: By default, code suggestions are automatically offered if you stop tying in SQL Editor for one second. You can turn off the automated suggestion feature on the Code Assist preferences page. If automated code suggestion is disabled, you can still access the suggestion window using the following method: 1 2 Click the line that you want SQL Editor to suggest an object for. Press (CTRL + Spacebar) on your keyboard. SQL Editor reads the line and presents a list of tables, views or columns as appropriate based on statement elements. NOTE: On a per platform basis, auto-suggestion behavior may vary. (For example, the WITH statement on DB2 platforms.)
To modify object suggestion parameters, including setting it from automatic to manual, see Set Code Assist Preferences.
Understanding Hyperlinks
SQL Editor supports hyperlinks that are activated when a user hovers their mouse over a word and presses the CTRL key. If a hyperlink can be created, it becomes underlined and changes color. When the hyperlink is selected, the creation script for the hyperlink object is opened in a new editor. Hyperlinks can be used to link to tables, columns, packages, and other reference objects in development code. Additionally, hovering over a hyperlink on a procedure or function of a call statement will open it. You can also use the hyperlink feature on function calls in DML statements.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
28
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Clicking a hyperlink performs an action. The text editor provides a default hyperlink capability. It allows a user to click on a URL (for example, www.embarcadero.com) and database object links. Hyperlink options (look and feel) can be modified via the Hyperlinking subnode in the Editors > Text Editors node of the Preferences panel. NOTE: Hyperlink functionality relies on certain objects being captured in the Object Index. If the index is turned off, or has been restricted in what information it captures, users will be unable to link them (as they are non-existent within the Index.) To specify object index types, see Set Data Source Indexing Preferences.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
29
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
30
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Custom Code Formatting Example 2 The following chart indicates a list of custom code formatting parameters and corresponding values. The chart is followed by the actual syntax as it would appear in SQL Editor based on the formatting parameter values. Compare the parameters and formatted code in Example 1 with this example for a concept of how custom formatting works. Custom Code Formatting Parameter
Stack commas separated by lists? Stack Lists with ___ or more items. Indent Size? Preceding commas? Spaces after comma? Trailing commas? Spaces before comma? Right align FROM and WHERE clauses with SELECT statement? Align initial values for FROM and WHERE clauses with SELECT list? Place SQL keywords on their own line? Indent size? Indent batch blocks? Number of new lines to insert Indent Size Right Margin? Stacked parentheses when they contain multiple items? Stack parentheses when list contains ___ or more items. Indent Size? New line after first parentheses? Indent content of conditional and looping constructs? Number of new lines to insert? Indent size?
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
31
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
32
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
The editor window automatically inserts collapsible nodes in the appropriate lines of code for organizational purposes. This enables you to expand and collapse statements, as needed, while developing code in particularly large or complicated files.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
33
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Definition
If a SELECT statement contains missing join criteria, when it is executed, it can produce a Cartesian product between the rows in the referenced tables. This can be problematic because the statement will return a large number of rows without returning the proper results. The code quality check detects missing join criteria between tables in a statement and suggests join conditions based on existing foreign keys, indexes, and column name/type compatibility. Example The following statement is missing a valid JOIN criteria: SELECT * FROM employee e,customer c, sales_order s WHERE e.employee_id = c.salesperson_id The code quality check fixes the above statement by adding an AND clause: SELECT * FROM employee e,customer c, sales_order s WHERE e.employee_id = c.salesperson_id AND s.customer_id = c.customer_id Note: This code quality check is valid for Oracle, DB2, and Sybase-specific join conditions.
When an invalid outer join operator exists in a SELECT statement, (or the outer join operator is missing altogether), the statement can return incorrect results. The code quality check detects invalid or missing join operators in the code and suggests fixes with regards to using the proper join operators. Example The following statement is missing an outer join operator: SELECT * FROM employee e, customer c WHERE e.employee_id = c.salesperson_id (+) AND c.state = CA The code quality check fixes the above statement by providing the missing outer join operator to the statement: SELECT * FROM employee accustoming c WHERE e.employee_id = c.salesperson_id(+) AND c.state(+) = CA
Transitivity issues
The performance of statements can sometimes be improved by adding join criteria, even if a join is fully defined. If this alternate join criteria is missing in a statement, it can restrict the selection of an index in Oracles optimizer and cause performance problems. The code quality check detects possible join conditions by analyzing the existing conditions in a statement and calculating the missing, alternative join criteria. Example The following statement contains a transitivity issue with an index problem: SELECT * FROM item i, product p, price pr WHERE i.product_id = p.product_id AND p.product_id = pr.product_id The code quality check fixes the above statement with a tranisitivity issue by adding the missing join condition: SELECT * FROM item i, product p, price pr WHERE i.product_id = p.product_id AND p.product_id = pr.product_id AND i.product_id = pr.product_id
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
34
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Definition
It is considered bad format to place sub-queries in the WHERE clause of a statement, and such clauses can typically be corrected by moving the sub-query to the FROM clause instead, which preserves the meaning of the statement while providing more efficient code. The code quality check fixes the placement of sub-queries in a statement, which can affect performance. It detects the possibility of moving sub-queries from the FROM clause of the statement. Example The following statement contains a sub-query that contains an incorrect placement of a WHERE statement: SELECT * FROM employee WHERE employee_id = (SELECT MAX(salary) FROM employee) The code quality check fixes the above statement by correcting the sub-query issue: SELECT employee.* FROM employee (SELECT DISTINCT MAX(salary) col1 FROM employee) t1 WHERE employee_id = t1.col1
When utilizing the HAVING clause in a statement It is recommended to include as few conditions as possible while utilizing the HAVING clause in a statement. Rapid SQL Developer detects all conditions in a given HAVING statement and suggests equivalent expressions that can benefit from existing indexes. Example The following statement contains a HAVING clause that is in the wrong place: SELECT col_a, SUM(col_b) FROM table_a GROUP BY col_a HAVING col_a > 100 The code check fixes the above statement by replacing the HAVING clause with equivalent expressions: SELECT col_a, SUM(col_b) FROM table_a WHERE col_a > 100 GROUP BY col_a
In a SELECT statement, if an arithmetic operator is used on an indexed column in the WHERE clause, the operator can suppress the index and result in a FULL TABLE SCAN that can hinder performance. The code quality check detects these conditions and suggests equivalent expressions that benefit from existing indexes. Example The following statement includes an indexed column as part of an arithmetic operator: SELECT * FROM employee WHERE 1 = employee_id - 5 The code quality check fixes the above statement by reconstructing the WHERE clause: SELECT * FROM employee WHERE 6 = employee_id
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
35
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
Definition
When the data types of join or parameter declaration columns are mismatched, the optimizer is limited in its ability to consider all indexes. This can cause a query to be less efficient as the system might select the wrong index or perform a table scan, which affects performance. The code quality check flags mismatched or incompatible column types and warns that it is not valid code. Example Consider the following statement if Table A contains the column col int and Table B contains the column col 2 varchar(3): SELECT * FROM a, b WHERE a.col = b.col; In the above scenario, the code quality check flags the a.col = b.col part of the statement and warns that it is not valid code.
When comparing a column with NULL, the !=NULL condition may return a result that is different from the intended command, because col=NULL will always return a result of false. Instead, the NULL/IS NOT NULL operators should be used in its place. The code quality check flags occurrences of the !=NULL condition and replaces them with the IS NULL operator. Example The following statement includes an incorrect col = NULL expression: SELECT * FROM employee WHERE manager_id = NULL The code quality check replaces the incorrect expression with an IS NULL clause: SELECT * FROM employee WHERE manager_id IS NULL
Code templates are available for DML, ALTER, DROP, CREATE, and platform specific commands. A comprehensive set of DDL/DML templates are available, with statement alternatives varying by DBMS and specific DBMS versions. You can modify and create new templates via the SQL Templates panel on the Preferences dialog. See Set SQL Code Template Preferences for more information on how to create and alter SQL code templates.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
36
> CR E A T I N G A N D E D I T I NG S Q L F I L E S (S Q L E D I T O R )
The History view displays all recorded times the file was changed since its inception/introduction into the workspace. Double-click a time in the History view to access the Text Compare panel. It displays the text of the file after the change occurred at the time indicated in the History view.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
37
> E X E CU T I N G S Q L F I LE S
2 3
In the Local History of ... panel, select a previously recorded version of the file by clicking the appropriate timestamp. Click Replace. The contents of the currently-opened file revert to the contents of the file at the history point you selected in the dialog.
Alternatively, from the shortcut menu, select Replace With > Previous from Local History to replace the contents of the file with Rapid SQL Developers last recorded history point.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
38
> E X E CU T I N G S Q L F I LE S
Files are executed via the Execute SQL command in the Run menu, or by clicking the green arrow button in SQL Editor. When an SQL file is open in the Workspace, select it and choose a database and an associated catalog on which you want to execute the file via the lists in the Toolbar. You can click the execute icon to execute code on the specified database and catalog, start a transaction or commit a transaction, or modify SQL session options prior to execution. To execute a file: Open the SQL file you want to run, ensure it is associated with the correct database, and click Execute. Rapid SQL Developer executes the code on the data source you specified. Results are displayed in the Results view and can be exported to a file via the Data Export wizard, or displayed in multiple file formats (HTML, XML, and TXT formats). To execute a transaction: To execute transactions, you need to ensure that the auto commit feature is turned off. See Set SQL Execution Preferences for more information on how to turn off auto commit. Open the transaction file you want to run, ensure it is associated with the correct database, and click Start Transaction. Rapid SQL Developer executes the transaction on the data source you specified. Once the transaction runs, you can execute the file as normal. NOTE: Click Commit or Rollback to finish or cancel a transaction.
To commit a transaction: Open the transaction file you want to commit, ensure it is associated with the correct database, and click Commit Transaction. Rapid SQL Developer commits the transaction on the data source you specified. TIP: You can set transactions to auto-commit prior to execution on the SQL Execution node of the Preferences panel.
See Also: Associate an SQL File with a Data Source Configure an SQL Session Execute SQL Code View and Save Results
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
39
> E X E CU T I N G S Q L F I LE S
Changing a catalog via the drop down lists is the equivalent of issuing a USE DATABASE command on SQL Server, Sybase, and MySQL platforms. Any change will not affect the current connection, and the list automatically updates to display the name of the newly selected data source. To change or associate a registered data source with an SQL file: Click the database list and select the name of a registered database from the list provided. Depending on the state of the code in SQL Editor, Rapid SQL Developers behavior differs when the connection is made: TIP: If you are receiving multiple syntax errors, always check that the file is associated with the correct data source and corresponding database/catalog before troubleshooting further.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
40
> E X E CU T I N G S Q L F I LE S
To modify SQL session options: 1 Click the SQL Session Options icon in the Toolbar. The SQL Session Options dialog appears. 2 3 Click on individual parameters in the Value column to change the configuration of each property, as specified. Click Finish. The session options will be changed and Rapid SQL Developer will execute the code as specified when you execute it. Session options only apply to the corresponding editor and are not retained when executing multiple SQL files.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
41
> E X E CU T I N G S Q L F I LE S
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
42
> TR O U B LE S H O O T I N G
To save results: 1 Right-click on the Results view and select Save Data. The Save Data dialog appears.
Select the project name to which you want to save the results, enter a file name, choose the file parameters, and then choose a file format from the drop down menu. You can select delimited text file, Excel, XML, or HTML file formats. Click Finish. The results are saved in the directory location and format that you specified.
Troubleshooting
Rapid SQL Developer contains a number of views used exclusively to log and monitor the SQL development process.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
43
> TR O U B LE S H O O T I N G
The SQL Log captures all SQL commands executed by SQL Editor and the system. SQL Log entries are listed by SQL Statement name, Date issued, Host/Server, Service, User, Source, and the Time (in milliseconds) it took to execute the command.
The SQL Errors log automatically logs all SQL errors encountered when SQL commands are executed through Rapid SQL Developer. Errors are listed by Error Code, SQL State, error Details, Resource, and the Location of the error in the SQL file.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
44
> TR O U B LE S H O O T I N G
The Problems view captures syntactic and semantic errors and warnings in the files of the workspace. These entries typically take the form of error messages or warnings issued by the system over the course of a procedure execution. Problems are organized by Description (which indicates the type of problem logged), Resource, file Path, and Location. Using the Problems view, you can apply quick fixes to issues that Rapid SQL Developer detects, as well as locate other problems that have similar attributes.
See Also: View Log Details Maintain Logs Filter Logs Import and Export Error Logs Find and Fix SQL Code Errors Find and Fix Other Problems
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
45
> TR O U B LE S H O O T I N G
To view details about SQL Errors entries: Right-click the error whose details you want to view and select SQL Error Details.
The SQL Error Details dialog provides information about the specified SQL error. Additionally, you can double-click the error to view the problem code in SQL Editor. To view details about Problems Right-click the entry whose details you want to view and select Properties. The Properties dialog appears, summarizing the issue.
Maintain Logs
The SQL Log and SQL Errors views both contain commands that enable you to save, restore, or otherwise move log entries into files outside of Rapid SQL Developer. Additionally, both views also contain commands that enable the clearing of the view. The current editor option will only show users statements as generated by the active editor. To maintain log entries: All entries automatically captured by the Error Log are written to a file (.log suffix) that resides in the Workspace .metadata folder. From Rapid SQL Developer, right-click in the SQL Log and select Clear Log Viewer to remove all messages. In the shortcut menu, select Delete Log to delete the .log file. If entries are created after the Delete Log command is issued, Rapid SQL Developer will automatically generate a new .log file in the .metadata subfolder. NOTE: Old Error Log entries cannot be recovered once the .log file is deleted. To prevent data loss, archive the .log file via the Export command prior to deletion.
To clear the Error Log view without deleting the .log file, select Clear Log Viewer from the shortcut menu. The View will be cleared of entries, but these entries will still be contained in the .log file.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
46
> TR O U B LE S H O O T I N G
To restore the Error Log view based on the entries contained in the .log file, select Restore Log from the shortcut menu. The View is restored based on the entries in the .log file.
Filter Logs
Filters can be applied to Problems, SQL Log, and the SQL Error Log to limit searches when troubleshooting and pinpointing specific processes within the system. To filter the SQL Log: Select the Toolbar Menu icon (the downward-pointing arrow in the right-hand corner of the view) and choose Filters. The SQL Log Filters dialog appears.
In the SQL Statement Types frame, select Successful or Failed to filter by the type of Error Log entries. Select Limit display statements to indicate a maximum limit of the number of entries displayed in the Error Log, and enter the maximum entry value in the corresponding field. Select Show statements with host to indicate that only entries from a specific data source are to be displayed, then type the name of the data source (as it appears in the Database Explorer) in the corresponding field. In the Filter by Source pane, specify User, System Generated, or Unavailable Source to filter statements by the type of source from where they originated. To filter the Problems log: Select the Toolbar Menu icon and choose Configure Contents. The Configure Contents dialog appears:
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
47
> TR O U B LE S H O O T I N G
The Filters dialog enables the creation of multiple filter profiles that can be applied to the log via the Toolbar Menu. The User Filters panel on the left-hand side of the dialog displays all existing filter profiles stored in the Workspace. Initially, the Workspace only contains the Default filter profile. Selecting it displays its filter parameters, and selecting the check box associated with its name enables the filter in the Problems view (only problems that match the criteria defined in the Filters dialog will appear in the view). The ability to define different profiles enables the selection of multiple filter profiles. For each profile selected, the profile criteria is applied to the View, concurrently. You can filter problems by: Working Set Character String Problem Severity Problem Type A combination of the above four filter options
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
48
> TR O U B LE S H O O T I N G
Profile Criteria
Working Set
Description
The options located in the center of the dialog enable you to filter problems based on defined Working Sets. A Working Set is a collection of user-defined Project files that you can organize, as needed, in Rapid SQL Developer. Select an option, and then click Select to define a Working Set to which the parameters apply. If no Working Sets exist, you need to define one or more via the New button on the Select Working Set dialog. Select one or more Working Sets to which you want the criteria to apply. If no Working Sets exist, or none suitably match the current filter criteria, click New or Edit to define a new Working Set, or edit an exist Working Set, respectively.
Character String
Use the Description list to select contains or doesnt contain, as needed, and type the character string in the field below the list. The Problems view is filtered to only contain, or omit, problem descriptions that fully or partially match the string value. Select the Where severity is check box and choose Error, Warning, Info, or some combination of the three check boxes. Only entries whose severity matches the check boxes you have selected remain visible in the Problems view. The options in the Show items of type list on the right-hand side of the dialog enable you to filter problems by type. Deselect Problem to remove any system entries from the view, or deselect SQL Error Marker to remove any SQL code entries from the view.
Problem Severity
Problem Type
Once you have defined and/or selected the appropriate filter profiles, the profiles will appear in the Filters submenu in the Toolbar Menu of the Problems view. Select or deselect the profiles from the submenu, as needed.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
49
> TR O U B LE S H O O T I N G
To navigate to the source of an SQL error entry: Right-click the the entry to which you want to navigate and select Go To. The file to which the error applies automatically opens in a new instance of SQL Editor, and the line is highlighted in the window.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
50
> TR O U B LE S H O O T I N G
To apply a quick fix to an issue in the Problem view: 1 2 Right-click on a problem in the list and select Quick Fix from the menu. The Quick Fix dialog appears. Select a fix from the list provided and click OK. Rapid SQL Developer attempts to resolve the issue.
To find similiar issues: 1 2 In the Quick Fix dialog, click Find Similiar Problems. The Problems list populates with all of the issues that are similiar to your initial selection. Use the check boxes beside the problems to select them, and then choose a fix and click OK. Rapid SQL Developer attempts to resolve all of the specified issues.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
51
Initial Setup
The following topics provide general help for configuring Rapid SQL Developer: Specify a Workspace License Rapid SQL Developer Additionally, the following preferences are available to help you customize and tune functions within the application: Set Data Source Indexing Preferences Set SQL Editor Preferences Set SQL Execution Preferences Set Code Assist Preferences Set Code Formatter Preferences Set Results View Preferences Set Syntax Coloring Preferences Set SQL Filter Preferences Set SQL Code Template Preferences Set File Encoding Preferences Set Data Source Preferences
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
52
C O N FI G U RI N G R A P I D S Q L D E V E LO P E R > C US T O M I Z I NG RA P I D S Q L D E V E L O P E R ( P R E F E RE NC E S )
Specify a Workspace
When you start Eclipse or the Rapid SQL Developer standalone application for the first time, you are prompted to create a workspace.
Click Use this as the default and do not ask again to set the specified folder as the permanent default workspace. For more information about workspaces, see Help > Help Contents > Workbench User Guide.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
53
C O N FI G U RI N G R A P I D S Q L D E V E LO P E R > C US T O M I Z I NG RA P I D S Q L D E V E L O P E R ( P R E F E RE NC E S )
However, there is a definitive trade-off when indexing a full database schema. The time it takes to fully capture a large schema and logical space considerations on local workstations, often makes it inefficient for Rapid SQL Developer to perform this task each time a new data source is registered in Rapid SQL Developer. Thus, the Index can be configured via the Rapid SQL Developer Preferences dialog to accommodate machine processing ability and speed. By default, when a data source connects to Rapid SQL Developer, the Index automatically begins indexing its schema. Data Source Indexing parameters enable you to indicate how schema caching behaves by specifying at what level data source objects will be indexed, the specific catalogs, schemas, and data source objects to index, and other factors that speed up the indexing process at a cost of slower retrieval for those objects not indexed by the process. Additionally, over the course of a Rapid SQL Developer session, index information is periodically updated by Rapid SQL Developer. The index refresh process uses the same specified parameters as the initial indexing process and therefore can cause application slowdown and performance issues if the index behavior has not been configured in an efficient manner. Rapid SQL Developer also provides the ability to index at the individual data source level. In Data Source Explorer, right-click on a data source and select Properties, then on the Properties dialog, choose Data Source Indexing to access index options for the specified data source. To configure the global index: 1 Select Window > Preferences > SQL Development > Data Source Indexing. Change the settings as appropriate: The window displays a list of database objects as they are organized in the Database Explorer view. Use the check boxes beside each object to specify the data sources that are to be included in the indexing process. Select Clear Index to delete the Object Index each time the application is started. Select the Apply SQL Filters tab if you want to apply any pre-defined filters to the index. If you are having performance problems due to a caching issue (such as a configuration error), the Stop Indexing, Clear Indexing, and Start Indexing buttons enable you to stop, clear, and/or restart the index process, respectively. The Max. number of objects to index field indicates how many logical data source objects can be indexed before the Index has reached maximum size. The Objects to include in index pane contains a list of data source objects. Select or clear the check boxes beside each data source object to indicate the specific data source objects that are included and excluded, respectively, from the indexing process. The Index Expiration Time (hours) setting indicates that an index job will not start automatically until the specified number of hours have passed. The index can also be started manually via Start Indexing. 2 When you are finished configuring the Index, click Apply to save your changes.
To configure individual data source indexing: 1 2 In Data Source Explorer, right-click on the data source you want to specify indexing, and select Properties. The Properties dialog appears. Choose Data Source Indexing and modify the properties, as required:
Choose Enable Data Source Specific Settings to indicate to Rapid SQL Developer that you want to specify individual indexing properties for this data source. Data sources that do not have this option selected will index under global indexing parameters.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
54
C O N FI G U RI N G R A P I D S Q L D E V E LO P E R > C US T O M I Z I NG RA P I D S Q L D E V E L O P E R ( P R E F E RE NC E S )
The window displays a list of database objects as they are organized in the Database Explorer view. Use the check boxes beside each object to specify the data sources that are to be included in the indexing process. Select Clear Index to delete the Object Index each time the application is started. Select the Apply SQL Filters tab if you want to apply any pre-defined filters to the index. If you are having performance problems due to a caching issue (such as a configuration error), the Stop Indexing, Clear Indexing, and Start Indexing buttons enable you to stop, clear, and/or restart the index process, respectively. The Objects to include in index pane contains a list of data source objects. Select or clear the check boxes beside each data source object to indicate the specific data source objects that are included and excluded, respectively, from the indexing process. The Index Expiration Time (hours) setting indicates that an indexing job will not start automatically until the specified number of hours have passed. The index can also be started manually via Start Indexing.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
55
C O N FI G U RI N G R A P I D S Q L D E V E LO P E R > C US T O M I Z I NG RA P I D S Q L D E V E L O P E R ( P R E F E RE NC E S )
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
56
C O N FI G U RI N G R A P I D S Q L D E V E LO P E R > C US T O M I Z I NG RA P I D S Q L D E V E L O P E R ( P R E F E RE NC E S )
Click on the check box beside each template to specify if it is included in the code assist check or not, within SQL Editor. Use the buttons on the right-hand side of the panel to create, edit, or delete SQL templates, as needed. When you create or edit a template, the Edit SQL Template dialog appears.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
57
C O N FI G U RI N G R A P I D S Q L D E V E LO P E R > C US T O M I Z I NG RA P I D S Q L D E V E L O P E R ( P R E F E RE NC E S )
Enter a Name, Description, and Pattern in the fields provided, and click OK. If the template name doesnt match an existing SQL code template, your new template is added to the list, and will automatically be considered when the code assist function is executed in SQL Editor. Select the Use Code Formatter check box to apply code formatting preferences to the specified template. See Set Code Formatter Preferences for more information about setting code formatter preferences.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
58
C O N FI G U RI N G R A P I D S Q L D E V E LO P E R > C US T O M I Z I NG RA P I D S Q L D E V E L O P E R ( P R E F E RE NC E S )
The default encoding for text files on Windows platforms is Cp1252. You can change unicode support in Rapid SQL Developer from file to file using the Text File Encoding options available on the Workspace panel. To change text file encoding in the development environment: 1 2 Select Window > Preferences > General > Workspace and click the Other option under Text File Encoding. Use the drop down menu and select an encoding mode from the list provided. Click Apply to keep your changes.
To change text file encoding on a specific, folder, or project in Rapid SQL Developer: 1 2 Right-click on the file, folder or project that you want to modify and choose Properties. Modify the encoding selection on the Resource properties page that appears.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
59
C O N FI G U RI N G R A P I D S Q L D E V E LO P E R > C US T O M I Z I NG RA P I D S Q L D E V E L O P E R ( P R E F E RE NC E S )
To change the directory location of the data source definitions, click Browse in the Data Sources field and specify a new directory where definitions will be stored. To change the directory location of the data source metadata, click Browse in the Metadata field and specify a new directory where metadata will be stored.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
60
Reference
The following topics provide reference details: Database Objects DBMS Connection Parameters by Platform
Database Objects
The following table describes the database objects displayed in Rapid SQL Developer and contains information regarding each one, including object name, DBMS platform, and any notes pertaining to the specified object. In Rapid SQL Developer, database objects are stored in Data Source Explorer as subnodes of individual, pertinent databases. Database Object
Aliases
DBMS Platforms
DB2 for LUW, DB2 for z/OS
Notes
An alias is an alternate name that references a table, view, and other database objects. An alias can also reference another alias as long as the aliases do not reference one another in a circular or repetitive manner. Aliases are used in view or trigger definitions in any SQL statements except for table check-constraint definitions. (The table or view name must be referenced in these cases.) Once defined, an alias is used in query and development statements to provide greater control when specifying the referenced object. Aliases can be defined for objects that do not exist, but the referenced object must exist when a statement containing the alias is compiled. Aliases can be specified for tables, views, existing aliases, or other objects. Create Alias is a command available on the shortcut menu.
Check Constraints
All
A check constraint is a search condition applied to a table. When a check constraint is in place, Insert and Update statements issued against the table will only complete if the statements pass the constraint rules. Check constraints are used to enforce data integrity when it cannot be defined by key uniqueness or referential integrity restraints. A check condition is a logical expression that defines valid data values for a column.
Clusters
Oracle
A cluster is a collection of interconnected, physical machines used as a single resource for failover, scalability, and availability purposes. Individual machines in the cluster maintain a physical host name, but a cluster host name must be specified to define the collective as a whole. To create a cluster, you need the CREATE CLUSTER or CREATE ANY CLUSTER system privilege.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
61
R E F E R E N C E > D ATA B AS E O B J E C TS
Database Object
Database Links
DBMS Platforms
Oracle
Notes
A database link is a network path stored locally, that provides the database with the ability to communicate with a remote database. A database link is composed of the name of the remote database, a communication path to the database, and a user ID and password (if required). Database links cannot be edited or altered. To make changes, drop and re-create.
Defaults Directories
Defaults promote data integrity by supplying a default value to a table column if the user does not explicitly provide one. Directories create an alias to an external operating system directory to your database files, which can be used for storing large binary object files. A domain provides a way to define a new data type.
Interbase, Firebird
Used to encrypt a databases pages and/or the databases columns. A named error message that can be raised from a stored procedure. A foreign key references a primary or unique key of a table (the same table the foreign key is defined on, or another table and is created as a result of an established relationship). Its purpose is to indicate that referential integrity is maintained according to the constraints. The number of columns in a foreign key must be equal to the number of columns in the corresponding primary or unique key. Additionally, the column definitions of the foreign key must have the same data types and lengths. Foreign key names are automatically assigned if one is not specified.
Functions
DB2, Oracle
A function is a relationship between a set of input data values and a set of result values. For example, the TIMESTAMP function passes input data values of type DATE and TIME, and the result is TIMESTAMP. Functions can be built-in or user-defined. Built-in functions are provided with the database. They return a single value and are part of the default database schema. User-defined functions extend the capabilities of the database system by adding function definitions (provided by users or third-party vendors) that can be applied in the database engine itself. A function is identified by its schema, a function name, the number of parameters, and the data types of its parameters. Access to functions is controlled through the EXECUTE privilege. GRANT and REVOKE statements are used to specify who can or cannot execute a specific function or set of functions.
Groups
All
Groups are units that contain items. Typically, groups contain the result of a single business transaction where several items are involved. For example, a group is the set of articles bought by a customer during a visit to the supermarket.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
62
R E F E R E N C E > D ATA B AS E O B J E C TS
Database Object
Indexes
DBMS Platforms
All
Notes
An index is an ordered set of pointers to rows in a base table. Each index is based on the values of data in one or more table columns. An index is an object that is separate from the data in the table. When an index is created, the database builds and maintains it automatically. Indexes are used to improve performance. In most cases, access to data is faster with an index. Although an index cannot be created for a view, an index created for the table on which a view is based can improve the performance of operations on that view. Indexes are also used to ensure uniqueness. A table with a unique index cannot have rows with identical keys. DB2: Allow Reverse Scans, Percent Free (Lets you type or select the percentage of each index page to leave as free space when building the index, from 0 to 99), Min Pct Used (Lets you type or select the minimum percentage of space used on an index leaf page. If, after a key is removed from an index leaf page, the percentage of space used on the page is at or below integer percent, an attempt is made to merge the remaining keys on this page with those of a neighboring page. If there is sufficient space on one of these pages, the merge is performed and one of the pages is deleted. The value of integer can be from 0 to 99. Oracle: The Logging, No Sort, Degrees, and Instances properties are documented in the editor.
Java Classes
Oracle
A model or template, written in Java language, used to create objects with a common definition and common properties, operations and behavior. Java classes can be developed in Eclipse (or another Java development environment such as Oracle JDeveloper) and moved into an Oracle database to be used as stored procedures. Java classes must be public and static if they are to be used in this manner. When writing a class to be executed within the database, you can take advantage of a special server-side JDBC driver. This driver uses the users default connection and provides the fastest access to the database. Java classes become full-fledged database objects once migrated into the database via the loadjava command-line utility or the SQL CREATE JAVA statement. A Java class is published by creating and compiling a call specification for it. The call spec maps a Java methods parameters and return type to Oracle SQL types. Once a Java class is developed, loaded, and published -- the final step is to execute it.
Oracle Oracle
A Java resource is a collection of files compressed in a .jar file. Java Sources contain the uncompiled Java source code.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
63
R E F E R E N C E > D ATA B AS E O B J E C TS
Database Object
Libraries
DBMS Platforms
Oracle
Notes
A library is a configurable folder for storing and sharing content with an allocated quota. Multiple libraries may exist in the same database environment. A library is a special type of folder in Oracle Content Services. Unlike Containers and regular folders, each library has a Trash Folder and an allocated amount of disk space. A library is composed of a name (mandatory), description, quota, path, and library members. The library service allows you to create folders, list quotas, and manage categories, workflow, trash folders, and versioning. The Library service does not allow you to create or upload files.
Materialized Views
Oracle
A database object that contains the results of a query. They are local copies of data located remotely, or are used to create summary tables based on aggregations of table data. Materialized views are also known as snapshots. A materialized view can query tables, views, and other materialized views. Collectively, these are called master tables (a replication term) or detail tables (a data warehouse term). For replication purposes, materialized views allow you to maintain copies of remote data on your local node. These copies are read-only. If you want to update the local copies, you need to use the Advanced Replication feature. You can select data from a materialized view as you would from a table or view. For data warehousing purposes, the materialized views commonly created are aggregate views, single-table aggregate views, and join views.
Oracle
Because Materialized Views are used to return faster queries (a query against a materialized view is faster than a query against a base table because querying the materialized view does not query the source table), the Materialized View often returns the data at the time the view was created, not the current table data. There are two ways to refresh data in Materialized Views, manually or automatically. In a manual refresh, the Materialized View is completely wiped clean and then repopulated with data from the source tables (this is known as a complete refresh). If source tables have changed very little, however, it is possible to refresh the Materialized View only for changed records -- this is known as a fast refresh. In the case of Materialized Views that are updated via fast refresh, it is necessary to create Materialized View Logs on the base tables that compose the Materialized View to reflect the changes. If the number of entries in this table is too high, it is an indication that you might need to refresh the Materialized Views more frequently to ensure that each update does not take longer than it needs. Select owner, then select from tables with Materialized Views, etc.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
64
R E F E R E N C E > D ATA B AS E O B J E C TS
Database Object
Oracle Job Queue
DBMS Platforms
Oracle
Notes
The Oracle Job Queue allows for the scheduling and execution of PL/SQL stored procedures at predefined times and/or repeated job execution at regular intervals, as background processes. For example, you could create a job in the Oracle Job Queue that processed end-of-day accounting -- a job that must run every weekday, but can be run unattended, or you could create a series of jobs that must be run sequentially -- such as jobs that might be so large, that in order to reduce CPU usage, only one is run at a time. Runs PL/SQL code at specified time or on specified schedule, can enable/disable.
Outlines
Oracle
Oracle preserves the execution plans of frozen access paths to data so that it remains constant despite data changes, schema changes, and upgrades of the database or application software through objects named stored outlines. Outlines are useful for providing stable application performance and benefit high-end OLTP sites by having SQL execute without having to invoke the cost-based optimizer at each SQL execution. This allows complex SQL to be executed without the additional overhead added by the optimizer when it performs the calculations necessary to determine the optimal access path to the data.
Packages
A package is a procedural schema object classified as a PL/SQL program unit that allows the access and manipulation of database information. A package is a group of related procedures and functions, together with the cursors and variables they use, stored together in the database for continued use as a unit. Similar to standalone procedures and functions, packaged procedures and functions can be called explicitly by applications or users. DB applications explicitly call packaged procedures as necessary with privileges granted, a user can explicitly execute any of the procedures contained in it. Packages provide a method of encapsulating related procedures, functions, and associated cursors and variables together as a unit in the database. For example, a single package might contain two statements that contain several procedures and functions used to process banking transactions. Packages allow the database administrator or application developer to organize similar routines as well as offering increased functionality and database performance. Packages provide advantages in the following areas: encapsulation of related procedures and variables, declaration of public and private procedures, variables, constraints and cursors, separation of the package specification and package body, and better performance. Encapsulation of procedural constructs in a package also makes privilege management easier. Granting the privilege to use a package makes all constructs of the package assessable to the grantee. The methods of package definition allow you to specify which variables, cursors, and procedures are: public, directly accessible to the users of a package, private, or hidden from the user of the package.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
65
R E F E R E N C E > D ATA B AS E O B J E C TS
Database Object
Package Bodies
DBMS Platforms
Oracle
Notes
A package body is a package definition file that states how a package specification will function. In contrast to the entities declared in the visible part of a package, the entities declared in the package body are only visible within the package body itself. As a consequence, a package with a package body can be used for the construction of a group of related subprograms in which the logical operations available to clients are clearly isolated from the internal entities.
Primary Keys
All
A key is a set of columns used to identify or access a row or rows. The key is identified in the description of a table, index, or referential constraint. The same column can be part of more than one key. A unique key is a key that is constrained so that no two of its values are equal. The columns of a unique key cannot contain NULL values. The primary key is one of the unique keys defined on a table, but is selected to be the key of the first importance. There can only be one primary key on a table. Oracle: If an index constraint has been defined for a table, the constraint status for the tables primary key cannot be set to Disabled.
Procedures
All
A procedure is an application program that can be started through the SQL CALL statement. The procedure is specified by a procedure name, which may be followed by arguments enclosed within parenthesis. The argument or arguments of a procedure are individual scalar values, which can be of different types and can have different meanings. The arguments can be used to pass values into the procedure, receive return values from the procedure, or both. A procedure, also called a stored procedure, is a database object created via the CREATE PROCEDURE statement that can encapsulate logic and SQL statements. Procedures are used as subroutine extensions to applications, and other database objects that can contain logic. When a procedure is invoked in SQL and logic within a procedure is executed on the server, data is only transferred between the client and the database server in the procedure call and in the procedure return. If you have a series of SQL statements to execute within a client application, and the application does not need to do any processing in between the statements, then this series of statements would benefit from being included in a procedure.
Profiles
Oracle
Profiles are a means to limit resources a user can use by specifying limits on kernel and password elements. Additionally, Profiles can be used to track password histories and the settings of specific profiles may be queried. The following kernel limits may be set: maximum concurrent sessions for a user, CPU time limit per session, maximum connect time, maximum idle time, maximum blocks read per session, maximum blocks read per call, and maximum amount of SGA.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
66
R E F E R E N C E > D ATA B AS E O B J E C TS
Database Object
Roles
DBMS Platforms
Oracle
Notes
A role is a set or group of privileges that can be granted to users to another role. A privilege is a right to execute a particular type of SQL statement or to access another users object. For example: the right to connect to a database, the right to create a tale, the right to select rows from another users table, the right to execute another users stored procedure. System privileges are rights to enable the performance of a particular action, or to perform a particular action on a particular type of object. Roles are named groups of related privileges that you grant users or other roles. Roles are designed to ease the administration of end user system and object privileges. However, roles are not meant to be used for application developers, because the privileges to access objects within stored progmmatic constructs needs to be granted directly.
Rules promote data integrity by allowing you to validate the values supplied to a table column. A sequence generates unique numbers. Sequences are special database objects that provide numbers in sequence for input into a table. They are useful for providing generated primary key values and for the input of number type columns such as purchase order, employee number, sample number, and sales order number. Sequences are created by use of the CREATE SEQUENCE command.
Structured Types
DB2
Structured Types are useful for modeling objects that have a well-defined structure that consists of attributes. Attributes are properties that describe an instance of the type. A geometric shape, for example, might have as attributes its list of Cartesian coordinates. A person might have attributes of name, address, and so on. A department might have a name or some other attribute.
Synonyms
A synonym is an alternate name for objects such as tables, views, sequences, stored procedures, and other database objects. A synonym is an alias for one of the following objects: table, object table, view, object view, sequence, stored procedure, stored function, package, materialized view, java class, user-defined object type or another synonym.
Tables
All
Tables are logical structures maintained by the database manager. Tables are composed of columns and rows. The rows are not necessarily ordered within a table. A base table is used to hold persistent user data. A result table is a set of rows that the database manager selects or generates from one or more base tables to satisfy a query. A summary table is a table defined by a query that is also used to determine the data in the table.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
67
R E F E R E N C E > D ATA B AS E O B J E C TS
Database Object
Tablespaces
DBMS Platforms
DB2 for LUW, DB2 for z/OS, Oracle
Notes
A tablespace is a storage structure containing tables, indexes, large objects, and long data. Tablespaces reside in database partition groups. They allow you to assign the location of database and table data directly onto containers. (A container can be a directory name, a device name, or a file name.) This can provide improved performance and more flexible configuration. A trigger defines a set of actions that are performed when a specified SQL operation (such as delete, insert, or update) occurs on a specified table. When the specified SQL operation occurs, the trigger is activated and starts the defined actions. Triggers can be used, along with referential constraints and check constraints, to enforce data integrity rules. Triggers can also be used to cause updates to other tables, automatically generate or transform values for inserted or updated rows, or invoke functions to perform tasks such as issuing alerts.
Triggers
All
Oracle Oracle
Types define an abstract data type or object composed of a collection of similar types of data. Type Bodies implement object type specification by containing the definition of every cursor and subprogram declared in the object type specification. In an Oracle database, Undo tablespace data is an image or snapshot of the original contents of a row (or rows) in a table. The data is stored in Undo segments in the Undo table space. When a user begins to make a change to the data in a row in an Oracle table, the original data is first written to Undo segments in the Undo tablespace. The entire process (including the creation of the Undo data is recorded in Redo logs before the change is completed and written in the Database Buffer Cache, and then the data files via the database writer (DBW) process.)
Undo Segments
Oracle
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
68
R E F E R E N C E > D BM S CO NN E C T I O N P AR A M E T E R S B Y P L ATF O R M
Database Object
Unique Keys
DBMS Platforms
All
Notes
A unique key is a key that is constrained so that no two of its values are equal. The columns of a unique key cannot contain null values. The constraint is enforced by the database manager during the execution of any operation that changes data values, such as INSERT or UPDATE. The mechanism used to enforce the constraint is called a unique index. Thus, every unique key is a key of a unique index. Such an index is said to have the UNIQUE attribute. A primary key is a special case of a unique key. A table cannot have more than one primary key. A foreign key is a key that is specified in the definition of a referential constraint. A partitioning key is a key that is part of the definition of a table in a partitioned database. The partitioning key is used to determine the partition on which the row of data is stored. If a partitioning key is defined, unique keys and primary keys must include the same columns as the partitioning key, but can have additional columns. A table cannot have more than one partitioning key. Oracle: You cannot drop a unique key constraint that is part of a referential integrity constraint without also dropping the foreign key. To drop the referenced key and the foreign key together, check the Delete Cascade option for the foreign key. Clustered: A cluster composes of a group of tables that share the same data blocks, and are grouped together because they share common columns and are often used together. Filegroup: Lets you select the filegroup within the database where the constraint is stored. Fill Factor: Lets you specify a percentage of how large each constraint can become.
Users Views
All All
A defined user. A view provides an alternate way of looking at the data in one or more tables. A view is a named specification of a result table and can be thought of as having columns and rows just like a base table. For retrieval purposes, all views can be used just like base tables. You can use views to select certain elements of a table and can present an existing table in a customized table format without having to create a new table.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
69
R E F E R E N C E > D BM S CO NN E C T I O N P AR A M E T E R S B Y P L ATF O R M
Oracle Connection Parameters Sybase Connection Parameters InterBase Connection Parameter Firebird Connection Parameters
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
70
R E F E R E N C E > D BM S CO NN E C T I O N P AR A M E T E R S B Y P L ATF O R M
Description
If you choose to use the alias from the IBM client, select the appropriate alias name. Otherwise, choose Generic JDBC Configuration and enter the connection parameters, as specified. The name of the database schema. Optional. Enter an ordered list of schema names to restrict the search scope for unqualified function invocations. The log on information required by Rapid SQL Developer to connect to the data source. Automatically attempts to connect to the data source when selected in Data Source Explorer, without prompting the user for connection information. The name of the JDBC Driver utilized by Rapid SQL Developer to initiate a JDBC standard access connection. Used by the JDBC Driver to connect with a data source. Often contains host and port numbers, as well as the name of the data source to which it connects. For example: jdbc:postgresql://host:port/database jdbc:derby://host:port/database
The name and property value of any custom JDBC drivers associated with the data source.
Description
If you choose to use the alias from the IBM client, select the appropriate alias name. Otherwise, choose Generic JDBC Configuration and enter the connection parameters, as specified. The name of the database schema. Optional. Enter an ordered list of schema names to restrict the search scope for unqualified function invocations. The log on information required by Rapid SQL Developer to connect to the data source. Automatically attempts to connect to the data source when selected in Data Source Explorer, without prompting the user for connection information. The name of the JDBC Driver utilized by Rapid SQL Developer to initiate a JDBC standard access connection. Used by the JDBC Driver to connect with a data source. Often contains host and port numbers, as well as the name of the data source to which it connects. For example: jdbc:postgresql://host:port/database jdbc:derby://host:port/database
The name and property value of any custom JDBC drivers associated with the data source.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
71
R E F E R E N C E > D BM S CO NN E C T I O N P AR A M E T E R S B Y P L ATF O R M
Description
If the data source utilizes a network library, select this parameter. The corresponding connection parameter fields become available. Otherwise, choose Generic JDBC Configuration and enter the connection parameters, as specified. The name of the data source. The listening port used in TCP/IP communications between Rapid SQL Developer and the data source. The communication mechanism between Rapid SQL Developer and the data source. Choose TCP/IP or Named Pipes. The default SQL database name, as defined by the schema. The log on information required by Rapid SQL Developer to connect to the data source. Automatically attempts to connect to the data source when selected in Data Source Explorer, without prompting the user for connection information. Enables trusted connections to the data source from Rapid SQL Developer. The name of the JDBC Driver utilized by Rapid SQL Developer to connect and communicate with the database. Used by the JDBC Driver to connect with a database. Often contains host and port numbers, as well as the name of the database to which it connects. For example: jdbc:postgresql://host:port/database jdbc:derby://host:port/database
Host/Instance (JDBC Configuration) Port (JDBC Configuration) (optional) Protocol (JDBC Configuration) Default Database (Optional) Security Credentials Auto Connect Allow Trusted Connections JDBC Driver (Advanced) Connection URL (Advanced)
The name and property value of any custom JDBC drivers associated with the data source.
Description
Used by the JDBC Driver to connect with a database. Often contains host and port numbers, as well as the name of the database to which it connects. For example: jdbc:postgresql://host:port/database jdbc:derby://host:port/database
The name of the data source to which you want Rapid SQL Developer to connect.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
72
R E F E R E N C E > D BM S CO NN E C T I O N P AR A M E T E R S B Y P L ATF O R M
Description
If the data source is mapped to a net service name via tnsnames.ora, select this parameter. Otherwise, choose Generic JDBC Configuration and enter the connection parameters, as specified. The name of the host machine on which the data source resides. The listening port used in TCP/IP communications between Rapid SQL Developer and the data source. Indicates if the data source is defined via a system identifier (SID) or a service name. The name of the system identifier (SID) or service name that identifies the data source. The log on information required by Rapid SQL Developer to connect to the data source. Automatically attempts to connect to the data source when selected in data source Explorer, without prompting the user for connection information. Enables trusted connections to the data source from Rapid SQL Developer. The name of the JDBC Driver utilized by Rapid SQL Developer to connect and communicate with the database. Used by the JDBC Driver to connect with a database. Often contains host and port numbers, as well as the name of the database to which it connects. For example: jdbc:postgresql://host:port/database jdbc:derby://host:port/database
Host/Instance (JDBC Configuration) Port (JDBC Connection) Type (JDBC Configuration) Service/SID Name (JDBC Configuration) Security Credentials Auto Connect Allow Trusted Connections JDBC Driver (Advanced) Connection URL (Advanced)
The name and property value of any custom JDBC drivers associated with the data source.
Description
If the data source is mapped to a name via SQL.INI, select this parameter to use that name for connection. Otherwise, choose Generic JDBC Configuration and enter the connection parameters, as specified. The name of the host machine on which the data source resides. The listening port used in TCP/IP communications between Rapid SQL Developer and the data source. The default database name, as defined by the schema. The name of the JDBC Driver utilized by Rapid SQL Developer to connect and communicate with the database. Used by the JDBC Driver to connect with a database. Often contains host and port numbers, as well as the name of the database to which it connects. For example: jdbc:postgresql://host:port/database jdbc:derby://host:port/database
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
73
R E F E R E N C E > D BM S CO NN E C T I O N P AR A M E T E R S B Y P L ATF O R M
Connection Parameter
Custom JDBC Driver Properties (Advanced)
Description
The name and property value of any custom JDBC drivers associated with the data source.
Description
The name of the host machine on which the data source resides. The listening port used in TCP/IP communications between Rapid SQL Developer and the data source. The default database name. The name of the JDBC Driver utilized by Rapid SQL Developer to connect and communicate with the database. Used by the JDBC Driver to connect with a database. Often contains host and port numbers, as well as the name of the database to which it connects. For example: jdbc:postgresql://host:port/database jdbc:derby://host:port/database
The name and property value of any custom JDBC drivers associated with the data source.
Description
The name of the host machine on which the data source resides. The listening port used in TCP/IP communications between Rapid SQL Developer and the data source. The default database name. The name of the JDBC Driver utilized by Rapid SQL Developer to connect and communicate with the database. Used by the JDBC Driver to connect with a database. Often contains host and port numbers, as well as the name of the database to which it connects. For example: jdbc:postgresql://host:port/database jdbc:derby://host:port/database
The name and property value of any custom JDBC drivers associated with the data source.
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
74
A
associating 39
J
JDBC connection 72
C
change history 37 code folding 32 code formatting 29
L
license 53 local history 38 log 49
D
data source 8 database objects 16, 61 DB2 LUW 71 delete 21 DMBS 6
N
nection 73 new_project_wizard_page 19 new_sql_file_wizard_page 23
O
object properties 12 objects 12 opening 19 Operating System 5 Oracle 73
E
editing 23 error 50 error detection 25 error logs 49 execute 42
P
PowerSQL 5 project_info_page 19 Projects 18
F
files 20 filters 16
G
global filters 17
S
SQL file 23 SQL Server 72 Sybase 73
H
Hardware 5 hyperlinks 28
T
technical Requirements 5
I
IBM DB2 LUW 71 Import 21
W
workspace 53
E M B AR C A DE R O TE C H N O L O G I E S > E M B A RC A D E R O RA P I D S Q L D E V E L O P E R 2. 1 U S E R G U I D E
75