Object type in pl/sql, PL-SQL Programming

Assignment Help:

Object Type:

The object type is a user-defined composite datatype which encapsulates a data structure along with the functions and procedures required to manipulate the data. The variables which form the data structure are known as the attributes. The functions and procedures which characterize the behavior of the object type are known as methods.

We typically think of an object (like a car, person, or bank account) as having behaviors and attributes. For illustration, a baby has the attributes age, gender, and weight, and the behaviors drink, eat, and sleep. The Object types maintain this perspective when you sit down to write an application.

Whenever you define an object type using the CREATE TYPE statement, you create an abstract template for several real-world objects. The template specifies only those behaviors & attributes that the object which will require in the application atmosphere. For illustration, an employee has numerous attributes, but usually only a few are required to fill the requirements of an application.

172_Object Type in pl-sql.png

Figure: Form Follows Function

 

Assume that you should write a program to allocate the employee bonuses. Not all the employee attributes are required to solve this problem.Therefore, you design an abstract employee who has the problem-specific attributes as: name, job title, id_number, department, salary, and rank. Then, you can identify the operations required to handle an abstract employee. For illustration, you require an operation which lets Management change the rank of an employee.

Later, you define a set of variables to present the data, and a set of subprograms to perform the operations. Lastly, you encapsulate the methods and attributes in an object type. The data structure created by the set of attributes is public. Though, well-behaved programs do not influence it directly. Rather, they use the set of methods provided. In that way, the employee data is kept in an appropriate state.

At run time, if the data structure is filled with values, you have created an illustration of an abstract employee. You can create as numerous instances (usually known as objects) as you require. Each object has the name, job title, and number, and so on of an actual employee. This data is accessed or changed only by the methods related with it. Therefore, the object types let you create objects with the well-defined behavior and attributes.

2140_Object Type in pl-sql1.png

Figure: Object Type and Objects (Instances) of That Type


Related Discussions:- Object type in pl/sql

Using operator ref - manipulating objects pl sql, Using Operator REF: ...

Using Operator REF: You can retrieve refs by using the operator REF that, like VALUE, takes as its argument a correlation variable. In the illustration below, you retrieve one

Row counterparts of table operators - sql, Row Counterparts of Table Operat...

Row Counterparts of Table Operators SQL does not have counterparts tuple rename, tuple projection, tuple extension, tuple join and tuple compose. To obtain the same effects as

Sql is a database language, SQL Is a Database Language: The commands g...

SQL Is a Database Language: The commands given to a DBMS by an application are written in the database language of the DBMS. The term data sublanguage is sometimes used instea

Understanding nested tables, Understanding Nested Tables Within the data...

Understanding Nested Tables Within the database, the nested tables can be considered as one-column database tables. The Oracle stores the rows of a nested table in no specific o

Effects of null for union - sql, Effects of NULL for union - SQL The ...

Effects of NULL for union - SQL The treatment of NULL in invocations of EXCEPT is as for UNION. This is different from its treatment in those of NOT IN and quantified compari

Literals in pl/sql, Literals A literal is an explicit numeric, string...

Literals A literal is an explicit numeric, string, character, or Boolean value not represented by an identifier. Numeric literal 147 and the Boolean literal FALSE are some of

Delete statement - syntax, DELETE Statement The DELETE statement elimin...

DELETE Statement The DELETE statement eliminates whole rows of data from the specified table or view. Syntax:

Other monadic - sql, Other monadic - SQL In 2VL there are just 4 (2 2 ...

Other monadic - SQL In 2VL there are just 4 (2 2 ) monadic operators, of which negation is really the only "useful" one. When a third truth value is introduced we have 27 (3 3

Updating tables in sql, Updating Tables in SQL The topic of updating b...

Updating Tables in SQL The topic of updating by describing the assignment operator, ":=" in Tutorial D. SQL uses a different syntax for assignment, using the key word SET and

In operator-comparison operators, IN Operator The operator IN tests the ...

IN Operator The operator IN tests the set membership. This means "equal to any member of." The set may have nulls, but they are ignored. For illustration, the statement below do

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd