Use the nocopy compiler hint - performance of application, PL-SQL Programming

Use the NOCOPY Compiler Hint

By default, the OUT and IN OUT parameters are passed by the value i.e. the value of an IN OUT actual parameter is copied into the corresponding formal parameter. Then, if the subprogram exits generally, the values assigned to OUT and IN OUT formal parameters are copied into the corresponding actual parameters.

If the parameters hold large data structures like records, collections, and instances of object types, all this copying slows down the execution and uses up memory. To secure that, you can specify the NOCOPY hint, that allows the PL/SQL compiler to pass OUT and IN OUT parameters by reference. In the illustration below, you ask the compiler to pass IN OUT parameter my_unit by reference rather by value:

DECLARE

TYPE Platoon IS VARRAY(200) OF Soldier;

PROCEDURE reorganize (my_unit IN OUT NOCOPY Platoon) IS ...

BEGIN

...

END;

Posted Date: 10/5/2012 4:58:15 AM | Location : United States







Related Discussions:- Use the nocopy compiler hint - performance of application, Assignment Help, Ask Question on Use the nocopy compiler hint - performance of application, Get Answer, Expert's Help, Use the nocopy compiler hint - performance of application Discussions

Write discussion on Use the nocopy compiler hint - performance of application
Your posts are moderated
Related Questions
Using SAVEPOINT The SAVEPOINT names and marks the present point in the processing of a transaction. Used with the ROLLBACK TO statement, the savepoints undo parts of a transac

Updating a Variable Assignment of an attribute value in a variable of a structured type Synatx: SET SN.C = 'S2'; As in Example the entire statement is equivalent to a

Initializing Records The illustration below shows that you can initialize a record in its type definition. Whenever you declare a record of the type TimeRec, its 3 fields supp

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

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:

Datatypes Every constant and variable has a datatype that specifies the storage format, constraints, and the valid range of values. The PL/SQL gives a variety of predefined dat

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

Organi c Evolution Evolution is a slow continuous, irreversible and natural process of change to give rise to advance and diverse forms of life i.e. formation of new specie

Example of GROUPBY Operator Example: How many students sat each exam, using GROUP BY, NATURAL LEFT JOIN, and COALESCE SELECT CourseId, COALESCE (n, 0) AS n FROM COURS

Declaring Cursor Variables Once a REF CURSOR type is define by you, and then you can declare the cursor variables of that type in any PL/SQL block or subprogram. In the exampl