Chapter 10 Oracle11g: PL/SQL Programming Oracle-Supplied Packages,

Slides:



Advertisements
Similar presentations
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 10 Oracle-Supplied Packages and SQL*Loader.
Advertisements

5 Copyright © Oracle Corporation, All rights reserved. Using Data Dictionary and Dynamic Performance Views.
Oracle11g: PL/SQL Programming Chapter 1 Introduction to PL/SQL.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Introduction to PL/SQL Chapter 9. Objectives Explain the need for PL/SQL Explain the benefits of PL/SQL Identify the different types of PL/SQL blocks.
Overview of SQL Server Alka Arora.
Oracle10g Developer: PL/SQL Programming1 Objectives Manipulating data with cursors Managing errors with exception handlers Addressing exception-handling.
Chapter 4 Cursors and Exception Handling Oracle10g Developer:
Benefits of PL/SQL. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –List and explain the benefits of PL/SQL –List.
Lesson 2 — The Internet and the World Wide Web
Objectives PL/SQL And Application Programming Application Models
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 11 Introduction to Dynamic SQL and Object Technology.
I Copyright © 2004, Oracle. All rights reserved. Introduction Copyright © 2004, Oracle. All rights reserved.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 7 PL/SQL Packages.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 6 Functions.
PL/SQLPL/SQL Oracle11g : PL/SQL Programming Chapter 6 Functions.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 1 Introduction to PL/SQL.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 3 Handling Data in PL/SQL Blocks.
Objectives Database triggers and syntax
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 9 Database Triggers.
Using Oracle-Supplied Packages. 2 home back first prev next last What Will I Learn? Describe two common uses for the DBMS_OUTPUT server-supplied package.
Dynamic SQL. 2 home back first prev next last What Will I Learn? Recall the stages through which all SQL statements pass Describe the reasons for using.
Oracle10g Developer: PL/SQL Programming1 Objectives SQL queries within PL/SQL Host or bind variables The %TYPE attribute Include queries and control structures.
PL/SQLPL/SQL Oracle11g: PL/SQL Programming Chapter 9 Database Triggers.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 9 Database Triggers.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 8 Program Unit Dependencies.
Oracle11g: PL/SQL Programming Chapter 3 Handling Data in PL/SQL Blocks.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
PL/SQLPL/SQL Oracle11g: PL/SQL Programming Chapter 10 Oracle-Supplied Packages, Dynamic SQL, and Hiding Source Code.
Oracle10g Developer: PL/SQL Programming1 Objectives Named program units How to identify parameters The CREATE PROCEDURE statement Creating a procedure.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Oracle9i Developer: PL/SQL Programming Chapter 5 Functions.
5 Copyright © 2004, Oracle. All rights reserved. PL/SQL Server Pages.
Douglas J. Partch, Jr. – Lead Nerd Protecting SQL Code Through DB2 LUW Obfuscation.
1 Chapter 5: Advanced PL/SQL Programming. 2 Anonymous PL/SQL Programs Write code in text editor, execute it in SQL*Plus Code can be stored as text in.
Preface IIntroduction Course Objectives I-2 Course Content I-3 1Introduction to Oracle Reports Developer Objectives 1-2 Business Intelligence 1-3 Enterprise.
E Copyright © 2006, Oracle. All rights reserved. Using SQL Developer.
Oracle9i Developer: PL/SQL Programming Chapter 6 PL/SQL Packages.
Preface IIntroduction Course Objectives I-2 Oracle Complete Solution I-3 Course Agenda I-4 Tables Used in This Course I-5 The Order Entry Schema I-6 The.
1 Copyright © 2004, Oracle. All rights reserved. PL/SQL Programming Concepts: Review.
D Copyright © 2009, Oracle. All rights reserved. Using SQL*Plus.
Glencoe Introduction to Multimedia Chapter 2 Multimedia Online 1 Internet A huge network that connects computers all over the world. Show Definition.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Architecture Review 10/11/2004
Project Management: Messages
Oracle11g: PL/SQL Programming Chapter 5 Procedures.
Working in the Forms Developer Environment
Chapter 8 Dependencies, Privileges and Compilation Oracle11g:
Oracle11g: PL/SQL Programming Chapter 1 Introduction to PL/SQL.
Analyzing the Database and Query Manager
Using Data Dictionary and Dynamic Performance Views
Introduction to Triggers
Section 17.1 Section 17.2 Add an audio file using HTML
Introduction to PL/SQL
Chapter 10: Application Layer
Using JDeveloper.
Chapter 10 Oracle9i Developer: PL/SQL Programming
HyperText Transfer Protocol
Chapter 7 Using SQL in Applications
Oracle9i Developer: PL/SQL Programming Chapter 8 Database Triggers.
Chapter 7 Using SQL in Applications
Prof. Arfaoui. COM390 Chapter 9
Procedures Oracle & MySQL
Prof. Arfaoui. COM390 Chapter 6
Handling Data in PL/SQL Blocks
Prof. Arfaoui. COM390 Chapter 7
iSecurity AP Journal Training
Presentation transcript:

Chapter 10 Oracle11g: PL/SQL Programming Oracle-Supplied Packages, Dynamic SQL, and Hiding Source Code

Objectives After completing this lesson, you should be able to understand: Generating output via packages Including large objects in the Oracle database Using communication packages Using important built-in packages Exploring dynamic SQL and PL/SQL Hiding PL/SQL source code Oracle11g: PL/SQL Programming

Brewbean’s Challenge Credit card verification Real-time messages E-mail generation Import external file data Include image files in the database Schedule program execution Oracle11g: PL/SQL Programming

Built-in Packages Oracle11g: PL/SQL Programming

Generating Output Oracle11g: PL/SQL Programming Built-in Package Name Description Script Filename DBMS_OUTPUT Displays data to the screen dbmsotpt.sql UTL_FILE Read and write data to external files utlfile.sql Oracle11g: PL/SQL Programming

DBMS_OUTPUT Displays data from within PL/SQL code Used heavily for debugging Enable DBMS_OUTPUT in SQL Developer The PUT procedure continues to place data on the same output line The PUT_LINE procedure will start a new line Oracle11g: PL/SQL Programming

DBMS_OUTPUT Oracle11g: PL/SQL Programming

DBMS_OUTPUT Example Oracle11g: PL/SQL Programming

UTL_FILE Enables reading and writing text data to operating system files (import and export data) Oracle11g: PL/SQL Programming

UTL_FILE Example - Write Oracle11g: PL/SQL Programming

UTL_FILE Example - Read Oracle11g: PL/SQL Programming

UTL_FILE Other file management procedures Oracle11g: PL/SQL Programming

Large Objects (LOBs) Handle media such as images, video segments, and large documents Oracle11g: PL/SQL Programming

LOBs Enable the storage of large objects as columns in a database table Can hold up to 4GB of data Multiple LOB columns allowed All except BFILE are stored internally in the database A LOB column contains pointer to actual LOB data Oracle11g: PL/SQL Programming

DBMS_LOB Example Oracle11g: PL/SQL Programming

DBMS_LOB Example Oracle11g: PL/SQL Programming

DBMS_ALERT Allows real-time messages or alerts to be sent to users upon a particular event Accomplished in a database trigger to be associated with an event An example use is online auctions Process includes: register an alert name, set when alert should signal, and identify users that should be recipients Oracle11g: PL/SQL Programming

DBMS_ALERT Example DBMS_ALERT.REGISTER(‘new_bid’); Register name DBMS_ALERT.REGISTER(‘new_bid’); Fire signal in database trigger DBMS_ALERT.SIGNAL(‘new_bid’, TO_CHAR(:new.bid)); Register recipient DBMS_ALERT.WAITONE(‘new_bid’, v_msg, v_status, 600); Oracle11g: PL/SQL Programming

UTL_MAIL Simplifies sending e-mail via a PL/SQL block Introduced in Oracle10g Scripts must be executed to set up the package SMTP server must be defined on the system Starting with Oracle11g, system administrator must create an access control list (ACL) Oracle11g: PL/SQL Programming

UTL_MAIL Example Oracle11g: PL/SQL Programming

UTL_HTTP Used to analyze HTML source of Web pages Makes Hypertext Transfer Protocol (HTTP) calls from within PL/SQL REQUEST_PIECES function will retrieve the HTML source of a specified URL in 2,000 byte segments Oracle11g: PL/SQL Programming

DBMS_DDL Allows access to two specific DDL statements: ALTER_COMPILE ANALYZE_OBJECT Oracle11g: PL/SQL Programming

Exploring More Oracle11g: PL/SQL Programming

Dynamic SQL Two mechanisms available DBMS_SQL package Native dynamic SQL Oracle11g: PL/SQL Programming

Dynamic SQL Oracle11g: PL/SQL Programming

DBMS_SQL - DML Oracle11g: PL/SQL Programming

DBMS_SQL - DML Oracle11g: PL/SQL Programming

DBMS_SQL - DDL Oracle11g: PL/SQL Programming

DBMS_SQL - DDL Oracle11g: PL/SQL Programming

DBMS_SQL - Queries Oracle11g: PL/SQL Programming

DBMS_SQL - Queries Oracle11g: PL/SQL Programming

DBMS_SQL - Queries Oracle11g: PL/SQL Programming

Native Dynamic SQL Simpler coding More efficient processing Limited capabilities compared to DBMS_SQL package Two methods EXECUTE IMMEDIATE OPEN FOR Oracle11g: PL/SQL Programming

Native Dynamic SQL - DML Oracle11g: PL/SQL Programming

Native Dynamic SQL - Query Oracle11g: PL/SQL Programming

Native Dynamic SQL - Query Oracle11g: PL/SQL Programming

Native Dynamic SQL – Open For Oracle11g: PL/SQL Programming

Native Dynamic SQL – Open For Oracle11g: PL/SQL Programming

DBMS_SQL VS. Native Dynamic SQL Using Native Dynamic SQL when Oracle11g: PL/SQL Programming

Hiding Source Code Obfuscating and wrapping refer to hiding PL/SQL code Protect source code Two methods Wrap utility DBMS_DDL package Oracle11g: PL/SQL Programming

Hiding Source Code Tips Oracle11g: PL/SQL Programming

Wrap Utility Oracle11g: PL/SQL Programming

DBMS_DDL CREATE_WRAPPED Oracle11g: PL/SQL Programming

Summary Oracle-supplied packages are pre-built packages to address common processing needs DBMS_OUTPUT allows data display UTL_FILE enables reading and writing to text files DBMS_LOB manages LOBs DBMS_ALERT enables event notification UTL_MAIL creates emails Oracle11g: PL/SQL Programming

Summary (continued) UTL_HTTP enables HTML source retrieval DBMS_DDL enables the COMPILE and ANALYZE commands to be processed within PL/SQL Dynamic SQL allows identifiers and DDL statements to process within PL/SQL DBMS_SQL package and native dynamic SQL are two mechanisms providing dynamic SQL capabilities Oracle11g: PL/SQL Programming

Summary (continued) Native dynamic SQL is simpler to code and executes more efficiently Two methods of hiding source code: wrap utility and DBMS_DDL package Oracle11g: PL/SQL Programming