Assignments in pl/sql, PL-SQL Programming

Assignments in pl/sql

The Variables and constants are initialized every time a block or subprogram is entered.
By default, the variables are initialized to NULL. Therefore, unless you expressly initialize the variable, its value is undefined, as the following illustration shows:

DECLARE
count INTEGER;
...
BEGIN
count := count + 1; -- assigns a null to count


The expression on the right side of the assignment operator yield NULL as count is null. To avoid the unpredicted results, never reference the variable before you assign it a value.

You can use assignment statements to assign the values to a variable. For illustration, the statement below assigns a new value to the variable bonus, overwriting its older value:

bonus := salary * 0.15;

The expression below the assignment operator can be randomly complex, but it must yield a datatype that is similar as or convertible to the datatype of the variable.

Posted Date: 10/3/2012 5:02:25 AM | Location : United States







Related Discussions:- Assignments in pl/sql, Assignment Help, Ask Question on Assignments in pl/sql, Get Answer, Expert's Help, Assignments in pl/sql Discussions

Write discussion on Assignments in pl/sql
Your posts are moderated
Related Questions
Aggregate Assignment The %ROWTYPE declaration cannot include an initialization clause. Though, there are two ways to assign values to all fields in a record at once. At First, t

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.

Positional and Named Notation You can write the actual parameters when calling a subprogram, using either positional or named notation. That is, you can point to the relationsh

What are the rates for help in writing PL/SQL procedures and functions?

THEO R Y OF PANSPERMIA - Arrhenius (1908) postulated the cosmic panspermia theory that claims that organisms existed throughout the universe, and their spores, etc., could

This task involves developing some functions that extract data from an SQL database. The scenario is that a company which owns an online vehicle search website wants to generate so

%NOTFOUND The %NOTFOUND is the logical opposite of the %FOUND. The %NOTFOUND yields TRUE when an INSERT, UPDATE, or DELETE statement affected no rows, or the SELECT INTO state

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

Scope Rules You cannot declare an exception twice in the similar block. Though, you can, declare the similar exception in 2 different blocks. The Exceptions declared in a bloc

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