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.

%ROWTYPE, %TYPE inherits the  definition of the column whereas

 

%ROWTYPE inherits all the column data types on a result set, For example:

Cursor staff-cursor is select * from staff-master; Staff-cursor-val          staff-cursor%ROWTYPE;

Staff-name-val           staff-cursor-val,staff-name%TYPE,

 

Here in the database staff-name has varchar2(200), hence staff-name-Val has been declared as varchar2(200), All the columns datatypes are assigned as in the table to this cursor staff-cursor-val, Another important role player command in PLlSQL is

If < some condition >

 

then < some action>

 

elsif < some condition >

 

then < some action>

 

else

 

< some condition>

 

end if;

 

 

18.01    How to use if conditions

 

for example :

 

if  avg-marks > 60  then

 

result "First Class"  - assigning some value to variable result elsif avg-marks > 50 then

result "Second Class"  -- assigning values else

result "Not qualified"  -- assigning values