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
what is the use of declare keyword

Avoiding Collection Exceptions   In many cases, if you reference a nonexistent collection element, then PL/SQL raises a predefined exception. Consider the illustration shown b

On occasion, some of Brewbean's customers mistakenly leave an item out of a basket already checked out, so they create a new basket containing the missing items. However, they requ

Left and Right Joins LEFT OUTER JOIN can be used when you want to retrieve the data from the main table (table1) even if there is no match in other tables (table_2, table_3...

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

Assignment of Variable - Updating a Variable Syntax: SET SN = SID ('S2'); This can obviously be read as "set the variable SN to be equal in value to SID ( 'S2' )".

Effects of NULL in Table Literal When a VALUES expression appears as the source value for an SQL INSERT statement, the key word NULL can appear as a field value, such that for

Example of COALESCE operator Example: Give the total of marks for each exam (simplified solution) SELECT CourseId, COALESCE ((SELECT SUM (Mark) FROM EXAM_MARK AS EM

Using the student and faculty tables create a select query that outputs all students for a specific advisor. Generate the execution plan, select out the explain plan . Create an

Sequential Control Dissimilar to the IF and LOOP statements, the GOTO and NULL statements are not important to the PL/SQL programming. The configuration of PL/SQL is such that th