Manipulating Database Objects

Similar documents
Building and Customizing an Interactive Report

Including Dynamic Images in Your Report

Creating a PDF Report with Multiple Queries

Building Database-Centric Web Applications Using. Oracle HTML DB

Oracle Application Express Workshop I Ed 2

Managing Your Database Using Oracle SQL Developer

1 Copyright 2013, Oracle and/or its affiliates. All rights reserved.

Oracle Database Express Edition

Installing Oracle Database 11g on Windows

Oracle Application Express

End User s Guide Release 5.0

Oracle Application Express

Oracle Application Express

Oracle Application Express Student Guide

An Oracle White Paper April Oracle Application Express 5.0 Overview

ACTIVE Net Insights user guide. (v5.4)

Mastering phpmyadmiri 3.4 for

Oracle Application Express SQL Workshop Guide. Release 18.1

Extend EBS Using Applications Express

APEX Times Ten Berichte. Tuning DB-Browser Datenmodellierung Schema Copy & Compare Data Grids. Extension Exchange.

Oracle Database 10g Express

Talend Open Studio for MDM Web User Interface. User Guide 5.6.2

Enterprise Reporting -- APEX

Oracle Application Express 5 New Features

Style Report Enterprise Edition

Oracle Database. 2 Day + Application Express Developer s Guide Release 3.0 B

Oracle Education Partner, Oracle Testing Center Oracle Consultants

Login: Quick Guide for Qualtrics May 2018 Training:

Oracle Database. 2 Day + Application Express Developer s Guide Release 4.2 for Oracle Database 12c E

Real Application Security Administration

Oracle Application Express SQL Workshop Guide. Release 18.2

Oracle APEX 18.1 New Features

Oracle Application Express: Administration 1-2

Oracle Database. Installation and Configuration of Real Application Security Administration (RASADM) Prerequisites

Oracle Reports Developer 10g: Build Reports

Oracle Application Express Users Guide

Database Foundations. 6-1 Introduction to Oracle Application Express. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Imagination To Realization

Imagine. Create. Discover. User Manual. TopLine Results Corporation

Oracle Reports Developer 10g: Build Reports

Using Sitecore 5.3.1

Oracle Applica7on Express (APEX) For E- Business Suite Repor7ng. Your friend in the business.

<Insert Picture Here>

Self-Demo Guide. Oracle ilearning and HTML DB

Rapid SQL 7.5 Evaluation Guide. Published: September 28, 2007

Oracle Fusion Middleware

Open World 2008 Hands-On Lab. JD Edwards EnterpriseOne Embedded BI Publisher. OOW 2008 Hands On Labs JD Edwards EnterpriseOne

Tutorial 8 Sharing, Integrating and Analyzing Data

REPORTING Copyright Framework Private Equity Investment Data Management Ltd

Wholesale Lockbox User Guide

ZENworks Reporting System Reference. January 2017

Nintex Forms 2010 Help

Microsoft Windows SharePoint Services

Team Members. Brief Description:

Partners. Brief Description:

Client Configuration Cookbook

Business Insight Authoring

Checkbox Quick Start Guide

SEPTEMBER 2018 ORACLE PRIMAVERA UNIFIER UNIFIER CUSTOM PRINT USING EXTERNAL DATA MODEL

Oracle Reports 6.0 New Features. Technical White Paper November 1998

Xerte. Guide to making responsive webpages with Bootstrap

SPARK. User Manual Ver ITLAQ Technologies

Hyperion Interactive Reporting Reports & Dashboards Essentials

Database Developers Forum APEX

Oracle Big Data Cloud Service, Oracle Storage Cloud Service, Oracle Database Cloud Service

Composer Guide for JavaScript Development

User Guide Product Design Version 1.7

ORACLE DATABASE 12C INTRODUCTION

Oracle SQL. murach s. and PL/SQL TRAINING & REFERENCE. (Chapter 2)

Learn how to login to Sitefinity and what possible errors you can get if you do not have proper permissions.


Oracle Database Express Edition

Working with Workbooks

Access Intermediate

Kaltura Video Package for Moodle 2.x Quick Start Guide. Version: 3.1 for Moodle

Apex 5.1 Interactive Grid and Other New features

SSRS 2016 for WITS. Web Portal User Guide. Applies to: WITS Version 18.0+

Oracle FLEXCUBE Investor Servicing BIP Report Development Guide Release 12.0 April 2012 Oracle Part Number E

User's Guide c-treeace SQL Explorer

Contents Using the Primavera Cloud Service Administrator's Guide... 9 Web Browser Setup Tasks... 10

Publish Joomla! Article

Publish Joomla! Article

Application Express 4.0 Architecture & Configuration Marc Sewtz Senior Software Development Manager Oracle America Inc.

Rapid Application Development with APEX 5.0

Course Overview. Copyright 2010, Oracle and/or its affiliates. All rights reserved.

IBM Forms V8.0 IBM Forms Classic - Forms Designer IBM Corporation

Building reports using the Web Intelligence HTML Report Panel

Using SQL with SQL Developer 18.2

Using the Prime Performance Manager Web Interface

Ektron Advanced. Learning Objectives. Getting Started

HOMELESS INDIVIDUALS AND FAMILIES INFORMATION SYSTEM HIFIS 4.0 TECHNICAL ARCHITECTURE AND DEPLOYMENT REFERENCE

GETTING STARTED. A Step-by-Step Guide to Using MarketSight

EMC Ionix ControlCenter (formerly EMC ControlCenter) 6.0 StorageScope

EMC Documentum D2. Administration Guide. User Guide. Version 4.2

Search Application User Guide

Creating consistent content pages

Finding Your Way Around Aspen IMS

Community Edition. Web User Interface 3.X. User Guide

Using the Open Class Report in MyReports Orientation, 2008

Report Commander 2 User Guide

Transcription:

Manipulating Database Objects Purpose This tutorial shows you how to manipulate database objects using Oracle Application Express. Time to Complete Approximately 30 minutes. Topics This tutorial covers the following topics: Overview Prerequisites Creating a Table from a Spreadsheet Adding a Master Table Modifying a Table Adding a Table Using a Script Adding a Constraint Summary Viewing Screenshots Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.) Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it. Overview What Is Oracle Application Express? Oracle Application Express is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. What Components Make Up Oracle Application Express? Oracle Application Express contains four main components: Application Builder Used to build database-centric interactive Web applications.

SQL Workshop Utilities Administration Used to access database objects, run SQL statements and SQL scripts. Used to Load and Unload data, Generate DDL, run Object Reports and manage the Recycle Bin. Used to manage services and users and to monitor activity. Terminology The following concepts are important to know when working with Oracle Application Express: Workspace A workspace is a virtual private database allowing multiple users to work within the same Oracle Application Express installation but keeping their objects, data and applications private. Application An application is a collection of pages with branches that connect them. Its attributes include the authentication method, default UI templates, and authorization rules. Page A page is the basic building block of an application. When you build an application in Application Builder, you create pages that contain user interface elements, such as tabs, lists, buttons, items, and regions. Region Content is displayed in regions, which are logical subsections of a page. Each page can have any number of regions of several different types. These types include: HTML text, SQL Queries, PL/SQL-generated HTML, and charts. Each region is rendered using a region template. Regions are positioned on the page using display points defined in the page template. Item An item can be a text field, text area, password, select list, check box, and so on. Item attributes affect the display and behavior of items on a page. For example, these attributes can impact where a label displays, how large an item is, and whether or not the item is displayed next to, or below the previous item. The value of an item is automatically stored into the application's session state, which can be referenced at any point within the user's session. Architecture Oracle Application Express lives completely within your Oracle database. It is comprised of nothing more than data in tables and large amounts of PL/SQL code. The essence of Oracle Application Express is approximately 165 tables and 200 PL/SQL objects containing 300,000+ lines of code. Whether you are running the Oracle Application Express development environment or an application you built using Oracle Application Express, the process is the same. Your browser sends a URL request that is translated into the appropriate Oracle Application Express PL/SQL call. After the database processes the PL/SQL, the results are relayed back to your browser as HTML. This cycle happens each time you either request a page or submit a page. The method behind the url translation depends on your Oracle version. Running Oracle Application Express in Oracle prior to 10.2.0.3 requires Apache and mod PL/SQL. In Oracle 10.2.0.3 and beyond, including Oracle Express Edition (XE), Oracle Application Express can use the embedded PL/SQL gateway or Apache. The application session state is managed in database tables within Oracle Application Express and does not use a dedicated database connection. Minimal CPU resources are consumed in the Application Express environment. If a user requests a page and is mentally processing the resultant page before making another request, the database could be stopped and restarted during the user s think time without any perceived outage by the user. What is new in Oracle Application Express 3.1? This release includes several major new features and enhancements.

Interactive Reports Interactive Reporting Regions enable end users to customize reports. Users can alter the layout of report data by choosing the columns they are interested in, applying filters, highlighting, and sorting. They can also define breaks, aggregations, different charts, and their own computations. Users can create multiple variations of the report and save them as named reports and download to various file formats including comma-delimited file (CSV) format, Microsoft Excel (XLS) format, Adobe Portable Document Format (PDF), and Microsoft Word Rich Text Format (RTF). Declarative BLOB Support Declarative BLOB support enable files to be declaratively uploaded in forms, and downloaded or displayed using reports. BLOB display and download can also be authored procedurally using PL/SQL. Enhanced Report Printing Report Queries now support multiple SQL statements, which allows for including multiple reports in a single document or combining reports and charts based on different result sets. The output format of a print document can now be set at runtime using a page or application item. In addition to PDF, Word, Excel and HTML, documents can now also be downloaded in XML format. Both report queries and report regions now allow specifying the method of how the print document is downloaded to the client, either as an attachment, displaying a file download / save dialog or showing the document inline within the browser window. The column sizing for print documents based on report regions has also been improved, now supporting sizing based on points in additional to percentage. Adding to the Theme Repository In addition to the default themes provided with Oracle Application Express, you can now add to the theme repository This enables you to design a very specific look and feel to meet your corporate requirements and then publish this as a theme for all other applications to use. This can be done at the workspace level (Workspace Themes) or at the instance level (Public Themes). Two new standard themes have also been added. Optional Runtime-Only Installation For testing and production instances, Oracle Application Express, release 3.1 supports the ability to install just a runtime version of Oracle Application Express. This minimizes the installed footprint and privileges. Scripts are also provided to remove or add the developer interface from an existing instance. This new feature improves application security since in a runtime instance developers cannot advertently update a production application. Improved Security There is a new 'Hidden and Protected' item type. Items of this type, after having been emitted in HTML and sent to the browser, cannot be altered in the page's HTML source and then POSTed to the application using that page. This, together with other minor improvements, makes the default security functionality more robust within Oracle Application Express. Documented JavaScript libraries You now have the ability to suppress standard JavaScript and CSS files. All included JavaScript files have been compressed to improve page load time. The framework has also been improved to allow advanced Oracle Application Express developers to build and leverage custom Web 2.0 capabilities. This increases performance and enables developers to create more dynamic application widgets.

Application Date Format You can define a date format that will be used throughout your application. This date format will be used to alter the NLS_DATE_FORMAT database session setting prior to showing or submitting any page within the application. This format is used by all reports showing dates and is also picked up by form items of type "Date Picker (use Application Date Format)". This can be set using: 1. Application Builder > Application Builder Defaults (under Tasks): These are specific to a Workspace, not a developer, and will be used as the default when using the create application wizard. 2. Application Builder > Create Application Wizard > Attributes page 3. Application Builder > Your Application > Shared Components > Edit Globalization Attributes Back to Topic List Prerequisites Before you perform this tutorial, you should: 1. Install Oracle Database 11g. 2. Install and configure Oracle Application Express. See documentation on OTN. 3. Download and unzip the apexintro.zip into your working directory. Back to Topic List Creating a Table from a Spreadsheet To load the data for this tutorial from a spreadsheet, perform the following steps: 1. Enter the following URL to log in to Oracle Application Express(change the <hostname> to localhost, your specific hostname or apex.oracle.com). http://<hostname>:8080/apex

2. To log in to Oracle Application Express, enter the following details, and click Login. Workspace: <your workspace name> Username: <your username> Password: <your password> 3. To create the table, click the down arrow next to Utilities > Data Load/Unload > Load.

4. Click Load Spreadsheet Data.

5. Ensure that the import target (Load To) is set to New table. For Load From, select the Upload file (comma separated or tab delimited) option. Click Next >. 6. Click Browse... 7. Locate the tasks.txt file (where you downloaded and unzipped the prerequisite files) and click Open. Because the data in the text file is tab delimited, enter \t in the Separator field. Click Next >.

8. The Table Information page displays the columns in the table and their formats, as well as the data to be inserted into the table after the table is created. For Table Name, enter OBE_TASKS, and click Next >. 9. Using the Primary Key page, you can add a system-generated primary key to your table and populate that column with a new sequence. Review the default values, and click Load Data.

10. After the table is created and the data is loaded, you are left on the Files page. You can see the file that you just uploaded with 16 rows successfully uploaded. To view your new table, click the SQL Workshop tab.

11. Select the down arrow next to Object Browser > Browse > Tables. 12. To view the table definition, click the OBE_TASKS table under the list of tables in the left navigator.

13. This page displays the table definition. To view the data in the table, click the Data tab.

14. You see all the data in the table. You can change any of the data in the table from this page, and also add rows to the table. Back to Topic List Adding a Master Table To make the project name maintainable and to be able to track other information about a project, you can move the Project information into a separate table. Perform the following steps: 1. Click the Table tab.

2. Click Create Lookup Table button.

3. To specify the column on which the master table is to be created, select PROJECT - varchar2, and click Next >. 4. Enter the following values, and click Next >. New Table Name: OBE_PROJECTS New Sequence: OBE_PROJECT_SEQ

5. Click Finish. 6. Notice that the new OBE_PROJECTS table contains a numeric primary key along with the PROJECT column. Back to Topic List Modifying a Table Now that you have the two main tables, enhance the OBE_PROJECTS table by adding some additional columns. To do this, perform the following steps:

1. Make sure the OBE_PROJECTS table is selected. You are going to add a column to the table. Click Add Column. 2. Enter the following values, and click Next >. Add Column: PROJECT_DEADLINE Type: DATE

3. Click Finish. 4. You see the modified table definition with the new PROJECT_DEADLINE column added. You want to create one more column for PROJECT_PRIORITY. Click Add Column. 5. Enter the following values, and click Next >. Add Column: PROJECT_PRIORITY Type: NUMBER Precision: 1

6. Click Finish. 7. The PROJECT_PRIORITY column is added. Click the Data tab to view the data.

8. You see all the projects that were referenced in the OBE_TASKS table. You can change data from here. Click the Edit icon ( ) on the left of PROJECT_ID for Public Website.

9. For Project Deadline, enter one month from today's date. Enter 1 for Priority. Then click Apply Changes. 10. You see the data that you added. Another way to create database objects and load data is to use a script. Select SQL Scripts from the drop down list box.

Back to Topic List Adding a Table Using a Script You may have noticed that the OBE_TASKS.ASSIGNED_TO column was a number. In this topic, you run a script to create the OBE_EMPLOYEES table and load a list of current employees. Each employee has an EMPLOYEE_ID that corresponds to the numbers found in the OBE_TASKS.ASSIGNED_TO column. Perform the following steps: 1. Click Upload.

2. Click Browse... 3. Select employees.sql (where you downloaded and unzipped the prerequisite files) and click Open. Enter OBE_EMPLOYEES for the Script Name and click Upload.

4. Select the OBE_EMPLOYEES script. 5. The script is shown. Click Run.

6. Click Run to confirm.

7. The script was executed. To view the results, click the View Results icon. 8. The OBE_EMPLOYEES table was created and some data was inserted. Click the SQL Workshop breadcrumb. Back to Topic List Adding a Constraint You now have the employee data that is referenced by the OBE_TASKS.ASSIGNED_TO column but need to identify a foreign key between the tables. The foreign key ensures that each ASSIGNED_TO column references a valid Employee. It also ensures that an Employee cannot be deleted who has tasks assigned. Perform the following steps:

1. Select the down arrow next to Object Browser > Browse and then select Tables. 2. Select the OBE_TASKS table and click the Constraints tab.

3. Click Create.

4. Select Foreign Key for the Constraint Type. Select ASSIGNED_TO for the Foreign Key Column, select OBE_EMPLOYEES for the Reference Table Name and select EMPLOYEE_ID from the Reference Table Column List. Then click Next >.

5. Click Finish. 6. The constraint was created successfully. You want to also create a check constraint on the PROJECT_PRIORITY column so that the data is validated when the data is inserted or updated. Select OBE_PROJECTS.

7. Click the Create section tab. 8. Select PROJECT_PRIORITY for the Constraint of Column field and enter in ('1','2','3') for the Constraint Expression. Ensure that Check Constraint Type is selected. Then click Next >.

9. Click Finish. 10. The constraint was created successfully. Click the Home breadcrumb. Back to Topic List Summary In this tutorial, you learned how to:

Create a table Modify a table Back to Topic List Place the cursor over this icon to hide all screenshots.