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

Attributes:

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:

(i) LONG & LONG RAW

(ii)NCHAR, NCLOB, & NVARCHAR2

(iii)ROWID & UROWID

(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
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

Overloading: Similar to packaged subprograms, methods of the same type can be overloaded. That is, you can use similar name for various methods if their formal parameters diff

Effects of NULL for Multiple Assignments - SQL If the row expression given as the source for a multiple assignment evaluates to NULL, then NULL is assigned to each target. If

Relational Algebra - SQL It describes some operators, that together constitute an algebra that is not only relationally complete but also irreducibly so (very nearly- apart f

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

Selecting Objects: Suppose that you have run the SQL*Plus script below that creates object type Person and object table persons, and that you have settled the table: CREATE

Using SAVEPOINT The SAVEPOINT names and marks the present point in the processing of a transaction. Used with the ROLLBACK TO statement, the savepoints undo parts of a transac

Assignment Statement: The assignment statement sets the present value of the variable, parameter, field, or element. The statement consists of an assignment target followed by

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

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