What is a collection, PL-SQL Programming

What Is a Collection


The collection is an ordered group of elements, all of similar type (for e.g. the grades for a class of students). Each element has a unique subscript which determines its position in the collection. The PL/SQL offers two collection types. The Items of type TABLE are either index-by tables or nested tables (that extend the functionality of the index-by tables). The Items of type VARRAY are varrays (short for the variable-size arrays).

The Collections works like the arrays found in most of the third-generation programming languages. Though, collections can have only one dimension and should be indexed by the integers. (In few languages like Ada and Pascal, the arrays can have multiple dimensions and can be indexed by the enumeration types.)

The Collections can store instances of an object type and, on the contrary, can be attributes of an object type. The collections can also be passed as parameters. Therefore, you can use them to move the columns of data into and out of the database tables or between client-side applications and stored subprograms. Moreover, you can define the collection types in a PL/SQL package, and then use them programmatically in your applications.

 

 

Posted Date: 10/3/2012 6:27:23 AM | Location : United States







Related Discussions:- What is a collection, Assignment Help, Ask Question on What is a collection, Get Answer, Expert's Help, What is a collection Discussions

Write discussion on What is a collection
Your posts are moderated
Related Questions
UNION ALL - SQL Further varieties of UNION arise when we replace the key word DISTINCT by ALL in any of the foregoing examples, as in Example. ALL specifies that if row r appe

Exceptions An exception is the runtime error or warning condition that can be predefined or user-defined. The Predefined exceptions are raised implicitly through runtime system

Closest Approximation to Relational Union - SQL Actually, just as SQL has several varieties of JOIN, it also has several varieties of UNION, none of which is equivalent to th

Declarations in SQL Your program stores values in the variables and constants. As the program executes, the value of the variables can change, but the values constants cannot.

Rollback Behavior When a FORALL statement fails, the database changes are rolled back to an implicit savepoint marked before each of the SQL statement execution. The Changes t

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

Example of NOT EXISTS in SQL Example: Use of NOT EXISTS CREATE ASSERTION Must_be_enrolled_to_take_exam_alternative1 CHECK ( NOT EXISTS (SELECT StudentId, CourseId

Second Step at defining type SID in SQL CREATE TYPE SID AS VARCHAR(5) ; Explanation: TYPE SID announces that a type named SID is being defined to the system.

Use Native Dynamic SQL A few programs (a normal-purpose report writer for illustration) should build and process a variety of SQL statements at run time. Therefore, their full

Named Notation The second procedure call uses the named notation. An arrow (=>) serve as the relationship operator that associates the formal parameter to the left of the arro