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
EXIT-WHEN The EXIT-WHEN statement permits a loop to complete conditionally. Whenever the EXIT statement is encountered, the condition in the WHEN clause is computed. When the co

Data Types in SQL - Decimal DECIMAL, NUMERIC, REAL, FLOAT and various other terms for various sets of rational numbers. When these key words are specified for the declared typ

Use the PLS_INTEGER Datatype When you require to declare an integer variable, use the datatype PLS_INTEGER that is the most efficient numeric type. That is as the PLS_INTEGER

Difference between 9i & 10G When Oracle releases any new databases then it are having some discrepancy with them. But 10G is having much difference than oracle 9i has. Oracle

Write an anonymous block that contains a PL/SQL procedure. The procedure takes two input parameter: oldZip and newZip, and it updates the zipcodes table by replacing all oldZip wit

Passing Cursor Parameters You use the OPEN statement to pass the parameters to a cursor. Unless you want to accept the default values, each proper parameter in the cursor decl

Using a join on 2 tables, select all columns and 10 rows from the 2 tables without the use of a Cartesian product. Query: SELECT * FROM EMPLOYEE1 E JOIN STAFF S ON E.EMP_

I need SQL to infopath data connection Project Description: Want data retrieval connection from SQL to SharePoint infopath Skills required are Sharepoint, SQL

Using EXISTS The EXISTS(n) returns TRUE if the nth element in a collection exist. Or else, EXISTS(n) returns FALSE. Primarily, you use EXISTS with DELETE to maintain the spars

Keyword and Parameter Description: label_name: This is an undeclared identifier which optionally labels the PL/SQL block. When used, label_name should be enclosed by the do