Product-specific packages, PL-SQL Programming

Product-specific Packages

The Oracle and different Oracle tools are supplied with the product-specific packages which help you to build the PL/SQL-based applications. For illustration, the Oracle is supplied with a lot of utility packages, a few of that are highlighted below.


The Package DBMS_STANDARD gives language facilities which help your application interact with the Oracle. For illustration, the procedure raise_application_error issue a user-defined error messages. In that way, you can report the errors to an application and evade returning the unhandled exceptions.


The Package DBMS_ALERT use the database triggers to alert an application when the definite database values change. The alerts are asynchronous (i.e., they operate separately of any timing mechanism) and transaction based. For illustration, a company may use this package to update the value of its investment portfolio as the new stock and bond quotes arrive.


The Package DBMS_OUTPUT enables you to display output from the PL/SQL subprograms and blocks, that makes it easier to test and debug them. The procedure put_ line results the information to the buffer in the SGA. You can display the information by calling the procedure get_line or by setting the SERVEROUTPUT ON in the SQL*Plus. For illustration, assume that you create the stored procedure which is as shown below:

CREATE PROCEDURE calc_payroll (payroll OUT NUMBER) AS

CURSOR c1 IS SELECT sal, comm FROM emp;


payroll := 0;

FOR c1rec IN c1 LOOP

c1rec.comm := NVL(c1rec.comm, 0);

payroll := payroll + c1rec.sal + c1rec.comm;


/* Display debug info. */

DBMS_OUTPUT.PUT_LINE('Value of payroll: ' || TO_CHAR(payroll));


Whenever you issue the commands below, the SQL*Plus display the value assigned by the procedure to the parameter payroll:



SQL> CALL calc_payroll(:num);

Value of payroll: 31225


The Package DBMS_PIPE allows various sessions to communicate over the named pipes. (A pipe is a region of memory used by one of the process to pass information to the other.) You can use the procedures pack_message & send_message to pack a message into the pipe, then it send to the other session in the similar instance.

At the other part of the pipe, you can use the procedures receive_message and unpack_message to receive and unpack the message. The Named pipes are helpful in many ways. For illustration, you can write the routines in C which allow an external servers to collect the information, then send it through pipes to the procedures stored in an Oracle database.


The Package UTL_FILE permits your PL/SQL programs to read & write operating system (OS) text files. It gives a restricted version of the standard OS stream file I/O, involving the open, put, get, and close operations. When you desire to read or write a text file, you call the function fopen that returns a file handle for use in consequent procedure calls. For illustration, the procedure put_line writes a text string and line terminator to an open file. The procedure get_line reads a line of the text from an open file into an output buffer.

The PL/SQL file I/O is accessible on both the client and server sides. Though, on the server side, the file access is constrained to those directories explicitly listed in the accessible directories list that is stored in the Oracle initialization file.


The Package UTL_HTTP permits your PL/SQL programs to make hypertext transfer protocol (HTTP) callouts. It can recover data from the Internet or call Oracle Web Server cartridges. The package has 2 entry points, each of that accepts a uniform resource locator (URL) string, links the specified site, and returns the requested data, that is usually in the hypertext markup language (HTML) format.

Posted Date: 10/8/2012 1:11:52 AM | Location : United States

Related Discussions:- Product-specific packages, Assignment Help, Ask Question on Product-specific packages, Get Answer, Expert's Help, Product-specific packages Discussions

Write discussion on Product-specific packages
Your posts are moderated
Related Questions
Perform the following queries on the Hospital1.DB using SQL Anywhere (START EARLY!). a. Which patients have purchased the drug "Tylenol"? List the names and addresses. Arrange the

What is Cursors how to use it in Real time application ?

Operators on Tables and Rows Row Extraction TUPLE FROM r, SQL has row subqueries. These are just like scalar subqueries except that they may specify more than one column.

Using %TYPE The %TYPE attribute gives the datatype of a variable or the database column. In the example below, the %TYPE gives the datatype of a variable: credit REAL(7,2); debi

Example of Check Constraints Example: Workaround for when subqueries not permitted in CHECK constraints CREATE FUNCTION NO_MORE_THAN_20000_ENROLMENTS ( ) RETURNS BOOLEAN

Scoping Within the similar scope, all the declared identifiers should be unique. So, even if their datatypes differ, the variables and parameters cannot share the similar name.

Hi there, I have the final part of a submission to do, it is a demonstration that takes place tomorrow. I do not have to use previous information, but i have resources that sho

Structure of an Object Type: Similar to package, an object type has 2 parts: the specification and the body. The specification is the interface to your applications; it declar

Cursors   To execute the multi-row query, the Oracle opens an unnamed work region which stores the processing information. The cursor names the work region, access the informa

Consider the schema for FreeChecking Bank, that we designed given below. Translate the given ER schema into SQL CREATE TABLE statements (indicating primary key, unique and foreign