Using the collection methods, PL-SQL Programming

Using the Collection Methods

The collection methods below help to generalize the code and make collections easier to use and also make your applications easier to maintain:

EXISTS

COUNT

LIMIT

FIRST and LAST

PRIOR and NEXT

EXTEND

TRIM

DELETE

A collection method is a built-in function or the process that operates on collections and is called using the dot notation. The syntax is as shown below:

collection_name.method_name[(parameters)]

The Collection methods can be called from the procedural statements but not from the SQL statements. The COUNT, EXISTS, LIMIT, FIRST, PRIOR, LAST, & NEXT are the functions, that appear as a part of an expression. And EXTEND, DELETE, and TRIM are the procedures that appear as a statement. Also, the EXISTS, TRIM, PRIOR, NEXT, EXTEND, and DELETE take parameters. Each parameter should be an integer expression. Only the EXISTS can be applied to automatically null collections. Whenever you apply another method to such type of collections, then the PL/SQL raises COLLECTION_IS_NULL.

Posted Date: 10/4/2012 3:12:26 AM | Location : United States







Related Discussions:- Using the collection methods, Assignment Help, Ask Question on Using the collection methods, Get Answer, Expert's Help, Using the collection methods Discussions

Write discussion on Using the collection methods
Your posts are moderated
Related Questions
What are 3 good practices of modeling and/or implementing data warehouses?

Case Sensitivity Similar to all the identifiers, the variables, the names of constants, and parameters are not case sensitive. For illustration, PL/SQL considers the following n

I want someone to write a TSQL function that returns the name of the ODBC DSN. I will use the queries below, to get information about the connection, but none of these return th

Using FOR UPDATE If you declare a cursor which will be referenced in the CURRENT OF clause of an UPDATE or DELETE statement, you should use the FOR UPDATE clause to obtain an

Relational Operators and Logical Operators It prepares the ground for subsequent sections in which each specific relational operator is paired with its logical counterpart, su

What Are Subprograms? The Subprograms are named PL/SQL blocks which can take parameters and be invoked. The PL/SQL has 2 types of subprograms known as the procedure s and func

Using the BULK COLLECT Clause The keywords BULK COLLECT specify the SQL engine to bulk-bind output collections before returning them to the PL/SQL engine. You can use these ke

Example of Table Literal - SQL Example: A Table Literal (correct version) VALUES ('S1', 'C1', 'Anne'), ('S1', 'C2', 'Anne'), ('S2', 'C1', 'Boris'), ('S3', 'C3'

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

Manipulating Local Collections Within PL/SQL, to manipulate the local collection, by using theĀ  TABLE and CAST operators . The operands of CAST are a collection declared locally