Data abstraction, PL-SQL Programming

Data Abstraction

The Data abstraction extracts the important properties of data while ignoring the not necessary details. Once you design a data structure, you can fail to remember the details and focus on designing algorithms that manipulate the data structure.


The collection types TABLE and VARRAY permit you to declare nested tables and variable-size arrays (varrays in short). A collection is an ordered group of elements, all of the similar type. Every element has a unique subscript that determines its place in the collection.

To reference an element, use the standard subscripting syntax. For e.g., the following call references the 5th element in the nested table returned by the function new_hires:


TYPE Staff IS TABLE OF Employee;

staffer Employee;

FUNCTION new_hires (hiredate DATE) RETURN Staff IS



staffer := new_hires('10-NOV-98')(5);



The Collections work like an array found in most third-generation programming languages. The collections can also be passed as parameters. And hence, you can use them to move columns of data into and out of database tables or between the client-side applications and stored subprograms.


You can use the %ROWTYPE attribute to declare a record that shows a row in a table or a row fetched from a cursor. Although, with a user-defined record, you can declare fields of your own. The Records contain exclusively named fields that can have different datatypes. Assume that you have different data about an employee like name, salary, & hire date. These items are not similar in type but logically related. Records containing a field for each item treat the data as a logical unit. Consider the example shown below:





date_held DATE,

duration TimeRec, -- nested record

location VARCHAR2(20),

purpose VARCHAR2(50));

Remember that you can nest the records. That is, the record can be the component of another record.

Posted Date: 10/2/2012 1:49:29 AM | Location : United States

Related Discussions:- Data abstraction, Assignment Help, Ask Question on Data abstraction, Get Answer, Expert's Help, Data abstraction Discussions

Write discussion on Data abstraction
Your posts are moderated
Related Questions
Calling Constructors: The Calls to a constructor are allowed wherever the function calls are allowed. Similarly to the functions, a constructor is called as a section of an ex

Avoid the NOT NULL Constraint In the PL/SQL, using the NOT NULL constraint incur a performance cost. Consider the illustration as shown below: PROCEDURE calc_m IS m NUMB

Table Represents an Extension - SQL It describes how each tuple in a relation represents a true instantiation of some predicate and each true instantiation is represented by s

How do I display usernames for students from a student table, assigning each student a username initials001 (initials is the actual student initials), and if the students initials

User-Defined Exceptions The PL/SQL defines the exceptions of your own. Dissimilar to the predefined exceptions, the user-defined exceptions should be declared and should be rai

Create the four tables and populate them with the given data. Answer the following queries in SQL. 1. Get all part-color/part-city combinations. Note: Here and subsequently, the

%ROWTYPE: This attribute gives a record type which represents a row in the database table or a row fetched from a formerly declared cursor. The Fields in the record and corresp

Brewbean's is implementing a new discount for return shoppers - every fifth completed order receives a 10% discount. The count of orders for a shopper is placed in a packaged varia

UPDATE Statement   The UPDATE statement transforms the values of the specified columns in one or more rows in the table or view. Syntax:

Positional Notation The first procedure call uses the positional notation. The PL/SQL compiler relates the first actual parameter, account, with the first proper parameter, ac