COURSE MATERAL- PL-SQL
It deals with programming.It is called third generation programming language, since it contains all the standard rules of programming.Difference between SQL and PL/sQL is, SQL is called Non-Procedural language since it deals with onlyWHAT data to be extracted, whereas PL/SQL is called Procedural language, since it deals with WHATdata to be extracted and HOW it should be displayed.
PL/SQL supports to write a program in 2 ways;
1. Anonymous block programming.2. Stored block programming.1. Anonymous block programming : A program which is written in nameless block. This program will beresiding in Operating system since it is created in .sql file.2. Stored block programming : A program which is written in named block and resides in database server.It includes Stored procedures, Stored functions, Stored packages and Triggers.
Advantages of PL/SQL:1. Supports for SQL
: DDL, DML, TCL, DQL, pseudo columns, functions which are used at SQL, thesame can be used in PL/SQL.
2. Better performance :
At SQL only 1 command is sent for execution to a server whereas at PL/SQLgroup of commands are stored in the form of a block and can send them for execution at once to a server,by which performance of application gets increases.
3. Portability :
The program which is written in PL/SQL on one platform can easily be transfered to theother platform.
4. Tight Integration with SQL:
Datatypes used at SQL, the same can be used at PL/SQL. It alsoprovides the new datatype called Composite datatypes which includes 2 datatypes; %TYPE ,%ROWTYPE
5. Procedural Capabilities :
Input/Output statements, IF conditional statements, Looping constructs,GOTO statement etc which are used at programming languages, the same can be used at PL/SQL.
6. Modularity :
A large application program can get split into small modules or blocks.Anonymous block Programming:
COPY RIGHTS RESERVED FOR
PEERS TECHNOLOGIES (P)Ltd