0% found this document useful (0 votes)
46 views6 pages

PL/SQL: Features: Block Structure Variables and Constants Control Structure Exception Handling

PL/SQL is a block-structured language that allows programmers to perform procedural programming in Oracle databases. It supports features like block structure, variables, control structures, exception handling, and modularity by using procedures and functions. PL/SQL also provides cursors to execute SQL statements, built-in functions, and attributes like %TYPE for declaring variables that match database column types and %ROWTYPE for variables that represent table rows.

Uploaded by

aishwarya saji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views6 pages

PL/SQL: Features: Block Structure Variables and Constants Control Structure Exception Handling

PL/SQL is a block-structured language that allows programmers to perform procedural programming in Oracle databases. It supports features like block structure, variables, control structures, exception handling, and modularity by using procedures and functions. PL/SQL also provides cursors to execute SQL statements, built-in functions, and attributes like %TYPE for declaring variables that match database column types and %ROWTYPE for variables that represent table rows.

Uploaded by

aishwarya saji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

PL/SQL

Features:
Block structure: block structure language.
Programs written as block.
Variables and constants: allows to declare
variables and constants.
Control structure:
Exception handling: allows to handle runtime
error. Whenever there is a pre-defined error
PL/SQL raises an exception automatically.
Modularity: allow processes to be divided
into different modules. Subprograms
called as procedures and functions are
defined.
Cursor: is a private SQL area used to
execute SQL stmts and store processing
infn.
Built in function
declare

Variable declaration

begin
Program execution

exception

Exception handling

End;
Program to add
declare
a number;
b number;
c number;
begin
a: = &a;
b:= &b;
c: =a+b;
dbms_output.put_line('The addition is ' ||c);
end;
%type: attribute provides the data type of
a variable. This particularly useful when
declaring variables the will hold db
values.
Eg: name Emp.ename%type;
%rowtype: A variable can be declared
with %rowtype that is equivalent to a row
of a table.
Emp_rec Emp%rowtype;
Assigning value to variable
Using assignment operator(:=)
Using select statement.
Syntax: select columname into variable
name from tablename;
Eg: select ename into name from emp;

You might also like