Sie sind auf Seite 1von 7

SUBJECT:

RDBMS
TOPIC: BRIEF HISTORY OF PL/SQL

SUBMMITED BY: KEERTHI-P

INTRODUCTION
SQL is a great query language, but it has its limitations. So oracle Corporation has added a procedural language extension to structured Query Language (PL/SQL).It is Oracles properiatory language for access of relational table data.PL/SQL is like any other high level compiler language.PL/SQL also possesses features of object-oriented languages, such as: Data encapsulation Error handling Information hiding Object-oriented programming(OOP)

BRIEF HISTORY OF PL/SQL


PL/SQL version 1.0 was introduced with Oracle 6.0 in 1991 . Version 1.0 had very limited capabilities , however, and was far from being a fullfledged programming language. It was merely used for batch processing. With versions 2.0, 2.1, and 2.2 the following new features were introduced. The transaction control statements SAVEPOINT, ROLLBACK, and COMMIT. The DML statements INSERT, DELETE, and UPDATE. The extended data types Boolean, BINARY_INTEGER ,PL/SQL records. Built-in functions-character, numeric , conversion ,and date functions. Built-in packages. The control structures sequence , selection ,and looping. Database access through work areas called cursors. Error handling. Modular programming with procedures and functions.

Stored procedures, functions, and packages. Programmer-defined subtypes. DDL support through the DBMS_SQL package. The PL/SQL wrapper. The DBMS_JOB job scheduler. File I/O with UTF_FILE package.

PL/SQL version 8.0 also known as PL/SQL8,came with Oracle8, the object-relational database software .Oracle allows creation of objects that can be accessed with java ,c++,object COBOL ,and other languages .It also allows objects and relational tables to coexist. The external procedures in oracle allow you to compile procedures and store them in the shared library of the operating system-for example, an .so file in UNIX or a .dll (Dynamic Linked Library)file in Windows .Oracles library is written in the C language. It also supports LOB (large Object) data types.

FUNDAMENTALS OF PL/SQL
A PL/SQL program consists of statements . You may use upper or lowercase letters in your program .In other words , PL/SQL is not case sensitive except for character string values enclosed in single quotes .Like any other programming language ,PL/SQL statements consist of Reserved words. Identifiers. Delimiters. Literals. Comments.

RESERVED WORDS
The reserved words ,or key words ,are words provided by the language that have a specific use in the language, For example , DECLARE, BEGIN,END IF,WHILE , EXCEPTION , PROCEDURE , FUNCTION , PACKAGE ,and TRIGGER are some of the reserved words in PL/SQL.

USER-DEFINED IDENTIFIER
User-defined identifiers are used to name variables , constants, procedures ,functions ,cursors ,tables ,records ,and exceptions. A user must obey the following rules in naming these identifiers: The name can be from 1 to 30 characters in length. The name must start with a letter. Letters (A-Z , a-z), numbers ,the dollar sign($),the number sign(#)and in the underscore(_)are allowed. Spaces are not allowed. Other special characters are not allowed. Key words cannot be used as user-defined identifiers. Names must be unique within a block. A name should not be the same as the name of a column used in the block. It is a good practice to create short and meaningful names. Fig: Valid user-defined identifiers
User-Defined Identifiers
Rate_of_pay Num A1234567890 Dollars$_and_cents SS#

Fig: Invalid user-defined identifier


Invalid User-Defined Identifiers Invalid User-Defined Identifiers Number Employee-name END Department number Largest_yearly_salary_paid_to_employees Taxrate % Reason Starts with a number Special character hyphen Reserved word Spaces Too long Special character %

Literals
Literals are values that are not represented by user-Defined identifiers. Literals are of three types: numeric , character ,and Boolean. For example: Numeric Character Boolean 100, 3.14, -55, 5.25E7,or NULL A, this is a string,0001,25-May-00, , or NULL TRUE , FALSE , or NULL

In this list of values,25-MAY-00 looks like a date value , but it is a character string . It can be converted to date format by using the TO_DATE function. The value (two single quotes having nothing within) is another way of entering the NULL value. PL/SQL is case sensitive regarding character values within single quotation marks .The values ORACLE ,Oracle , and oracle are three different values in PL/SQL .To embed a single quote in a string value ,two single quote symbols are entered-for example ,New Years Day. Numeric values can be entered in scientific notation with the letter E or e. Boolean values are not enclosed in quotation marks.

END

Das könnte Ihnen auch gefallen