Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

 

 

 

18- HOW TO LAND IN PL/SQL

PL/SQL is Oracle's procedural language. Consolidated or combined sol's Job may be classified as PLlSQL, Any business logic has been codified under this option, Generally, this has been group into blocks, Blocks may be named or anonymous, PLlSQL has got three sections such as "declarations", "executable commands", "exception handling". Variables are defined in the declarations section and starts with the word "declare", executable commands start with the word "begin" exception handling will start with "exception" and block should be terminated with "end".

We all familiar with declarations like

 

declare

 

l-temp0           number(l6,2);

 

l-templ           varchar2(200);

 

l-temp2           char(5);

 

l-temp3           constant number(l6,2) := 63,25;

 

CURSOR is another declaration type frequently used on PLlSQL, If anyone derives 5+3 = 8 and here 8 is a result, It can be stored in variable called l-temp0, Whereas if you select all the columns of restricted rows or all the rows can be viewed as RESULT SET, Referring the result set by single name may be called as CURSOR, In otherwise result set of SQL may be termed as CURSOR DATA TYPE and should be named, Apart from this, declared data types can be assigned to memory variables

declared under declaration section has got some roles like %TYPE,

 

 

 

l30