Components of an object type - attributes in pl/sql, PL-SQL Programming


Just similar to variable, an attribute is declared with a name and datatype. The name should be exclusive within the object type. The datatype can be any Oracle type excluding:




(iv)The PL/SQL-specific types BINARY_INTEGER (and its subtypes), PLS_INTEGER, BOOLEAN, RECORD, REF CURSOR, %TYPE, & %ROWTYPE

(v)The types defined within the PL/SQL package

You cannot initialize an attribute in its declaration by using the assignment operator or the DEFAULT clause. You cannot also impose the NOT NULL constraint on an attribute. Though, an object can be stored in the database tables on which you can impose the constraints.

The type of data structure formed by the set of attributes depends on the real-world object being modeled. For illustration, a rational number can present, that has a numerator and a denominator, you require only two INTEGER variables. On another hand, to present a college student, you require quite a few VARCHAR2 variables to hold the name, status, address, phone number, and so on, in addition to a VARRAY variable to hold the courses and grades.

The data structure can be mush complex. For illustration, the datatype of an attribute can be another object type (known as the nested object type). That lets you construct a complex object type from the simpler object types. Some object types like lists, queues, and trees are dynamic, meaning that they can grow as they are used. The Recursive object types, that contain direct or indirect references to themselves, permit for highly complicated data models.

Posted Date: 10/6/2012 8:02:41 AM | Location : United States

Related Discussions:- Components of an object type - attributes in pl/sql, Assignment Help, Ask Question on Components of an object type - attributes in pl/sql, Get Answer, Expert's Help, Components of an object type - attributes in pl/sql Discussions

Write discussion on Components of an object type - attributes in pl/sql
Your posts are moderated
Related Questions
What Are Cursor Variables  ? The Cursor variables are like C or Pascal pointers that hold the memory location (address) of some item rather of the item itself. Therefore, decl

Multiple Assignment- SQL SQL supports multiple assignment to local variables and also applies multiple assignment semantics in SET clauses of UPDATE statements, but does not

Renaming Columns - SQL SQL has no direct counterpart of RENAME. To derive the table on the right in Figure 4.4 from the table on the left, Tutorial D has IS_CALLED RENAME ( St

Subprograms The PL/SQL has two types of subprograms known as the procedures and functions that can take parameters and be invoked. As the following example represents, a subp

Ending Transactions A good quality programming practice is to commit or roll back every transaction explicitly. Whether you rollback or issue the commit in your PL/SQL program

Package STANDARD package named STANDARD defines the PL/SQL atmosphere. The package specification globally declares the exceptions, types, and subprograms that are available a

Type versus Representation Confusion in SQL This describes how a value might have two or more distinct representations. For example, user-defined type POINT might have a decla

Effects of NULL The numeric variable X, perhaps of type INTEGER, might be assigned NULL. In that case the result of evaluating X + 1 is NULL, and so SET Y = X + 1 assigns NULL

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

Question: (a) In the context of database security explain how the following database features help to enforce security in the database system: (i) Authorisation (ii) Access