PLSQL is the combination of SQL statements. To increase the capabilities of SQL PLSQL is introduced. Full form of PLSQL is 'Procedural Structured query language'.
* PL/SQL programs are divided and written in logical blocks of code. Each block consists of three sub-parts
- Declarations
- Executable Commands
- Exception Handling
* Following is the basic structure of a PL/SQL block
DECLARE
<declarations section>
BEGIN
<executable command(s)>
EXCEPTION
<exception handling>
END;
* The PL/SQL single-line comments start with the delimiter -- (double hyphen) and multi-line comments are enclosed by /* and */.
Example :
DECLARE
-- variable declaration
message varchar2(20):= 'Hello, World!';
BEGIN
/*
* PL/SQL executable statement(s)
*/
dbms_output.put_line(message);
END;
/
* A PL/SQL unit is any one of the following −
PL/SQL block
Function
Package
Package body
Procedure
Trigger
Type
Type body
No comments:
Post a Comment