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
Define basic operators of relational algebra with an example each

Packages The package is a schema object which groups logically associated to the PL/SQL items, types, and subprograms. The Packages have 2 sections: the specification & the bod

Many of the reports generated from the system calculate the total dollars in a shopper''s purchases. Follow these steps to create a function named TOT_PURCH_SF that accepts a shopp

1. Create a procedure called TAX_COST_SP to accomplish the tax calculation task. Keep in mind that the state and subtotal values are inputs into the procedure and the procedure is

Using SET TRANSACTION You use the SET TRANSACTION statement to begin the read-only or read-write transaction, start an isolation level, or assign your present transaction to a

Projection in SQL - correct version Student StudentId is enrolled on some course. SELECT DISTINCT StudentId FROM IS_ENROLLED_ON In more complicated examples it is someti

Project Description: We organize an online system called ACPAS we have created a project called EVO that can be use by our customers to integrate their web sites with the Acpas

Extension and AND in SQL The theory book gives the following simple example of relational extension in Tutorial D: EXTEND IS_CALLED ADD ( FirstLetter ( Name ) AS Initial )

How Transactions Guard Your Database The transaction is a sequence of SQL data manipulation statements which does a logical unit of work. The Oracle treats the sequence of SQL

BIOCHE M ICA L ORIGIN OF LIFE - It is generally agreed by astronomers, geologists and biologists that the earth is approximately 4500-5000 million years old. It is an