Using count, PL-SQL Programming

Assignment Help:

Using COUNT

The COUNT returns the number of elements that a collection presently contains. For instance, when a varray projects contains 15 elements, then the following IF condition is true:

IF projects.COUNT = 15 THEN...

The COUNT is very useful as the present size of a collection is not always known. For e.g. if you fetch a column of the Oracle data into a nested table, then how many elements does the table contain? The COUNT provides you the answer.

You can also use the COUNT where an integer expression is allowed. In the next e.g. you use COUNT to specify the upper bound of a loop range:

FOR i IN 1..courses.COUNT LOOP ...

For the varrays, the COUNT is always equals to LAST. For nested tables, COUNT generally equals to LAST. But, if you delete elements from the middle of a nested table, then the COUNT becomes smaller than LAST.


Related Discussions:- Using count

Named notation, Named Notation The second procedure call uses the name...

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

Solve the business problems using sql, Use the MASCOT tables CREDITRS, PORD...

Use the MASCOT tables CREDITRS, PORDS and PAYMENTS to write SQL queries to solve the following business problems. These tables / data are available to you via the USQ Oracle server

Commit statement in pl sql, COMMIT Statement The COMMIT statement expli...

COMMIT Statement The COMMIT statement explicitly makes everlasting changes to the database during the present transaction. The Changes made to the database are not considered e

Projection and existential quantification - sql, Projection and Existential...

Projection and Existential Quantification - SQL Intuitively it might seem that projection in SQL is simply a matter of specifying the required columns in the SELECT clause, a

Join query, Using a join on 3 tables, select 5 columns and 10 rows from the...

Using a join on 3 tables, select 5 columns and 10 rows from the 3 tables without the use of a Cartesian product Query: SELECT E.LAST_NAME, E.FIRST_NAME, S.BUILDING, S.BRAN

Loop statements, LOOP Statements The LOOP statements execute a series o...

LOOP Statements The LOOP statements execute a series of statements at multiple times. The loops enclose the series of statements that is to be repeated. The PL/SQL provides typ

Manipulating individual elements - pl/sql, Manipulating Individual Elements...

Manipulating Individual Elements Faraway you have manipulated an entire collection. Within the SQL, to manipulate the individual elements of the collection, and then use the ope

Create GUIs in PL/SQL, i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM

i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM

Defining autonomous transactions, Defining Autonomous Transactions To ...

Defining Autonomous Transactions To define an autonomous transaction, you use the pragma (compiler directive) AUTONOMOUS_TRANSACTION. The pragma instructs the PL/SQL compiler

Develop data business intelligence project, Develop Data Business Intellige...

Develop Data Business Intelligence Project Project Description: We are linking our Microsoft SQL Database to GoodData Business Intelligence. We are seeking somebody who has e

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd