PL/SQL Sample Code

These PL/SQL code samples demonstrate the use of various PL/SQL features in Oracle Database.

Sample Code — Oracle Database 10g

PL/SQL Sample Application - FORALL [12-Jan-2005]
Oracle Database 10g introduces support for the FORALL syntax with non-consecutive indexes in collections. The INDICES OF clause allows the FORALL syntax to be used with sparse collections, while the VALUE OF clause is used for collections of indexes pointing to other collections. This sample shows how to use these features in a PL/SQL application.
Readme Download(ZIP)

Regular Expressions - User Search Sample [13-Dec-2004]
This sample demonstrates the use of regular expression APIs to validate, search and extract information from the database using TRIGGERs, PROCEDUREs, CURSORs etc. Using the scenario of User Information system, this sample uses variety of patterns to search and extract user information such as hobbies and interest, location information etc stored in a database table.
Readme Download(ZIP)

Regular Expressions
- DNA Sample [01-Dec-2004]
This sample uses the regular expression APIs to parse the raw HTTP stream received from the SGD database, and extract only the DNA sequence. This sequence is stored in a table locally and further analyzed to identify certain enzyme patterns using regular expression functions.
Readme Download(ZIP)

Regular Expressions - User Validation Sample [28-Sep-2004]
Using a typical user registration scenario, this sample application uses the regular expression functions that are implemented in Oracle Database 10g to validate user inputs.
Readme Download(ZIP)

Sample Code — Oracle9i Database Release 2
The samples are completely self-contained except where they rely on objects in the Common Schema (especially the employees table). These objects are already installed in the pre-built database. They can be created in a custom-built database by running mksample.sql on the demo/schema direcory under the Oracle Home directory.
Associative arrays (index-by-varchar2 tables)
Using RECORD binds for SQL in PL/SQL programs
Utl_File: Overview of enhancements introduced in Oracle9i Database Version 9.2.0

Sample Code — Oracle9i Database Release 1
The samples are completely self-contained except where they rely on objects in the Common Schema (especially the employees table). These objects are already installed in the pre-built database. They can be created in a custom-built database by running mksample.sql on the demo/schema direcory under the Oracle Home directory.
Cursor reuse in PL/SQL static SQL

Using CASE Statements in PL/SQL programs
Bulk Binding Enhancements
Table Functions and Cursor Expressions
Multilevel Collections
Enhancements to the UTL_HTTP Package
B2B scenario illustrating the use of the UTL_HTTP Package (Version 9.0.1 and later)
Native Complilation

Send email from the database using the UTL_SMTP package
An application can notify interested parties by email (and provide relevant current data) when a particular database condition arises. (For example, when the field in a row representing a purchase requistion.)
Source

 
Left Curve
More PL/SQL Resources
Right Curve
 . PL/SQL Technology Page
 . Best Practice PL/SQL

Left Curve
More Sample Code
Right Curve
 . Advanced JDBC Samples
 . JDBC 2.0 Samples
 . JDBC 3.0 Samples
 . SQLJ Samples

Left Curve
Discussions
Right Curve
 . Sample Code
 . Database
 . SQL and PL/SQL Forum


E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy