Product-specific packages, PL-SQL Programming

Assignment Help:

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.

DBMS_STANDARD

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.

DBMS_ALERT

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.

DBMS_OUTPUT

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;

BEGIN

payroll := 0;

FOR c1rec IN c1 LOOP

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

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

END LOOP;

/* Display debug info. */

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

END;

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

SQL> SET SERVEROUTPUT ON

SQL> VARIABLE num NUMBER

SQL> CALL calc_payroll(:num);

Value of payroll: 31225

DBMS_PIPE

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.

UTL_FILE

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.

UTL_HTTP

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.


Related Discussions:- Product-specific packages

Authorize and fetch data from instagram, Authorize and fetch data from Inst...

Authorize and fetch data from Instagram Project Description: Incorporate Instagram feed on mobile site platform: c#, ms sql, jquerymobile, jquery Web admin Author

Sql cursor - syntax, SQL Cursor   The Oracle implicitly opens a cursor...

SQL Cursor   The Oracle implicitly opens a cursor to process each SQL statement not related with an explicit cursor. The PL/SQL refers to the most current implicit cursor as t

Map and order methods, Map and Order Methods: The values of the scalar...

Map and Order Methods: The values of the scalar datatype like CHAR or REAL have a predefined order that allows them to be compared. While, the instances of an object type has

Effects of null, Effects of NULL The numeric variable X, perhaps of ty...

Effects of NULL The numeric variable X, perhaps of type INTEGER, might be assigned NULL. In that case the result of evaluating X + 1 is NULL, and so SET Y = X + 1 assigns NULL

Keyword & parameter description - exception_init pragma, Keyword & Paramete...

Keyword & Parameter Description: PRAGMA: These keywords signify that the statement is a pragma (i.e. compiler directive). The Pragmas are processed at the compile time, n

Effects of null in aggregate operator - sql, Effects of NULL in Aggregate O...

Effects of NULL in Aggregate Operator - SQL Let aggop(x) be an invocation of some aggregate operator aggop in SQL, where x is an expression (usually an open expression) to be

I need simple hosted sql database, Project Description: I want a small r...

Project Description: I want a small relational database to be built. I want the database to have the subsequent information tables: Employee Information Document storage

Row counterparts of table operators - sql, Row Counterparts of Table Operat...

Row Counterparts of Table Operators SQL does not have counterparts tuple rename, tuple projection, tuple extension, tuple join and tuple compose. To obtain the same effects as

Change sql file into csv for product registration, Change Sql file into CSV...

Change Sql file into CSV for product registration on Magento Project Description: I have a set of files that are in Sql format and could like for a developer to help me with

Out mode - parameter modes, OUT Mode An OUT parameter returns values t...

OUT Mode An OUT parameter returns values to the caller of a subprogram. Within the subprogram, an OUT parameter act like a variable. That means that you can use an OUT formal

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd