Oracle Application Express SQL Workshop Guide

Transcription

Oracle Application ExpressSQL Workshop GuideRelease 4.2 for Oracle Database 12cE17964-06April 2013

Oracle Application Express SQL Workshop Guide, Release 4.2 for Oracle Database 12cE17964-06Copyright 2003, 2013, Oracle and/or its affiliates. All rights reserved.Primary Author: Drue SwadenerContributors: Marco Adelfio, Carl Backstrom, Christina Cho, Michael Hichwa, Christopher Jones, JoelKallman, Sharon Kennedy, Syme Kutz, Terri Jennings, Kris Rice, Marc Sewtz, Scott Spadafore, ScottSpendolini, Jason Straub, and Simon WattThis software and related documentation are provided under a license agreement containing restrictions onuse and disclosure and are protected by intellectual property laws. Except as expressly permitted in yourlicense agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverseengineering, disassembly, or decompilation of this software, unless required by law for interoperability, isprohibited.The information contained herein is subject to change without notice and is not warranted to be error-free. Ifyou find any errors, please report them to us in writing.If this is software or related documentation that is delivered to the U.S. Government or anyone licensing iton behalf of the U.S. Government, the following notice is applicable:U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software,any programs installed on the hardware, and/or documentation, delivered to U.S. Government end usersare "commercial computer software" pursuant to the applicable Federal Acquisition Regulation andagency-specific supplemental regulations. As such, use, duplication, disclosure, modification, andadaptation of the programs, including any operating system, integrated software, any programs installed onthe hardware, and/or documentation, shall be subject to license terms and license restrictions applicable tothe programs. No other rights are granted to the U.S. Government.This software or hardware is developed for general use in a variety of information managementapplications. It is not developed or intended for use in any inherently dangerous applications, includingapplications that may create a risk of personal injury. If you use this software or hardware in dangerousapplications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and othermeasures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damagescaused by use of this software or hardware in dangerous applications.Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks oftheir respective owners.Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarksare used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD,Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of AdvancedMicro Devices. UNIX is a registered trademark of The Open Group.This software or hardware and documentation may provide access to or information on content, products,and services from third parties. Oracle Corporation and its affiliates are not responsible for and expresslydisclaim all warranties of any kind with respect to third-party content, products, and services. OracleCorporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to youraccess to or use of third-party content, products, or services.

ContentsPreface . ixTopic Overview .Audience.Documentation Accessibility .Related Documents .Conventions .ixixxxxiChanges in This Release . xiiiChanges in Oracle Application Express Release 4.2 .1xiiiManaging Database Objects with Object BrowserAccessing Object Browser . 1-1About Object Browser . 1-2Searching for and Browsing Database Objects . 1-3Searching For and Selecting Database Objects . 1-3Hiding the Object Selection Pane. 1-4About Creating Database Objects. 1-4Managing Tables . 1-4Creating a Table. 1-5Browsing a Table . 1-7Editing a Table. 1-9Dropping a Table. 1-10Managing Views. 1-10Creating a View . 1-11Browsing a View . 1-11Editing a View . 1-12Compiling a View . 1-13Dropping a View . 1-13Managing Indexes . 1-13Creating an Index . 1-13Browsing an Index . 1-14Dropping an Index. 1-14Managing Sequences. 1-15Creating a Sequence. 1-15Browsing a Sequence . 1-15iii

Dropping a Sequence.Managing Types .Creating a Type .Browsing a Type.Dropping a Type .Managing Packages.Creating a Package.Viewing a Package .Editing a Package .Compiling a Package .Downloading a Package.Dropping a Package.Managing Procedures .Creating a Procedure .Browsing a Procedure .Editing a Procedure .Compiling a Procedure .Downloading a Procedure .Dropping a Procedure .Managing Functions .Creating a Function.Browsing a Function .Editing a Function.Compiling a Function .Downloading a Function.Dropping a Function.Managing Triggers .Creating Triggers .Browsing a Trigger.Editing a Trigger .Compiling a Trigger.Downloading a Trigger .Dropping a Trigger .Managing Database Links .Creating a Database Link .Browsing a Database Link .Dropping a Database Link .Managing Materialized Views.Creating a Materialized View.Browsing a Materialized View .Dropping a Materialized View.Managing Synonyms.Creating Synonyms.Viewing a Synonym.Dropping a Synonym 11-311-311-321-331-331-341-341-34

2Using SQL CommandsWhat is SQL Commands? . 2-1Accessing SQL Commands. 2-2About the SQL Commands Home Page. 2-2Using the Command Editor. 2-4Running a SQL Command. 2-5About Transactions in SQL Commands . 2-5About Unsupported SQL*Plus Commands . 2-6About Command Termination. 2-6Using Bind Variables . 2-6Using the Find Tables Icon . 2-6Saving an SQL Command . 2-8Copying a Command . 2-8Viewing Results. 2-8Accessing the Results Pane . 2-8About the Results Pane . 2-9Using Explain Plan. 2-9Viewing an Explain Plan. 2-9About Explain Plan Pane . 2-10Using Saved Commands . 2-10Accessing Saved Commands. 2-10About the Saved SQL Pane. 2-11Using SQL Command History. 2-11Accessing a Command from Command History . 2-12About the History Pane. 2-123Using SQL ScriptsWhat is SQL Scripts? . 3-1Accessing SQL Scripts. 3-1About the SQL Scripts Page. 3-2Creating a SQL Script . 3-4Creating a SQL Script in the Script Editor. 3-4Uploading a SQL Script. 3-4Using the Script Editor . 3-5Editing an Existing Script. 3-5Searching and Replacing Text or Regular Expressions . 3-6Summary of Script Editor Controls . 3-7Deleting a SQL Script. 3-7Deleting Scripts from the SQL Scripts Page . 3-7Deleting a Script in the Script Editor. 3-8Copying a SQL Script . 3-8Executing a SQL Script. 3-8Executing a SQL Script in the Script Editor. 3-9Executing a SQL Script from the SQL Scripts Page. 3-9Viewing SQL Script Results. 3-10Viewing Results from the SQL Scripts Page . 3-10v

About the Results Page .Exporting and Importing SQL Scripts .Copying Scripts to an Export Script .Importing Scripts from an Export Script .Viewing Script and Result Quotas.43-103-113-113-133-14Using Oracle Application Express UtilitiesBuilding SQL Queries with Query Builder . 4-1About Query Builder . 4-2Using the Object Selection Pane. 4-4Selecting Objects. 4-5Specifying Query Conditions . 4-7Creating Relationships Between Objects . 4-8Working with Saved Queries . 4-10Viewing Generated SQL. 4-12Viewing Query Results. 4-12Using the Data Workshop to Manage Data. 4-12About Importing, Exporting, Loading, and Unloading Data. 4-13Accessing the Data Load/Unload Page. 4-15Loading Data . 4-15Unloading Data . 4-18Using Repository. 4-19Generating DDL . 4-20Managing Methods on Tables. 4-20Managing User Interface Defaults. 4-21Creating User Interface Defaults for a Table. 4-21Modifying Table User Interface Defaults . 4-22Creating User Interface Attributes. 4-23Modifying User Interface Attributes . 4-23About Exporting and Importing User Interface Defaults . 4-24Viewing Database Details . 4-24Comparing Schemas . 4-25Viewing Object Reports. 4-25Table Reports . 4-26Security Reports . 4-26PL/SQL Reports . 4-27Exception Reports . 4-28All Object Reports . 4-28Monitoring the Database . 4-29Sessions . 4-30About System Statistics . 4-31About Top SQL. 4-32About Long Operations. 4-33Using the Recycle Bin to View and Restore Dropped Objects. 4-33Managing Objects in the Recycle Bin . 4-33Emptying the Recycle Bin Without Viewing the Objects . 4-34vi

5 Using RESTful ServicesWhat Is REST?. 5-1About RESTful Services . 5-2RESTful Service Requirements . 5-2Accessing RESTful Services. 5-3About the Example RESTful Service Module (oracle.example.hr) . 5-3Returning the Result Set in CSV Format (empinfo/). 5-5Retrieving Data Based on a Parameter (employees/{id}) . 5-7Returning the Result Set in JSON Format with Pagination Set (employees/) . 5-9Returning the Result Set as a Feed (employeesfeed/) . 5-12Returning the Result Set Based on a PL/SQL Block (empsecformat/{empname}) . 5-14Managing RESTful Service Modules. 5-17Creating a RESTful Service Module . 5-17Editing a RESTful Service Module . 5-18Deleting a RESTful Service Module . 5-19Managing RESTful Service Privileges. 5-20Exporting a RESTful Service Module. 5-22Importing a RESTful Service Module . 5-22Managing Resource Templates. 5-23Adding a Resource Template . 5-23Editing a Resource Template. 5-24Deleting a Resource Template. 5-24Managing Resource Handlers. 5-24Adding a Resource Handler .

Oracle Application Express SQL Workshop Guide describes how to use Oracle Application Express SQL Workshop and utilities to load and unload data from an Oracle database, generate DDL, view object reports, and restore dropped database objects. Topics: Topic Overview Audience Documentation Accessibility Related Documents Conventions