Until now, we have been working either with %TYPE or %ROWTYPE. This means we are working with either one value or one complete record. How do we create our own data type, with our own specified number of values to hold? This is where TYPE and RECORD come in. Those who are familiar with the C language can consider this to be a structure declaration. Let me explain this to you in detail.
Let us consider a table of about 20 columns. I always need to work with only seven of those columns. If I use %ROWTYPE, I get all 20 values unnecessarily. At the same time, my program will be bit clumsy if I use seven %TYPE declarations. A better way to solve this solution is by defining my own data type, which can hold seven values. Then I declare the variables of my new data type and work with them. The following example illustrates this.