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
Majority of Differences among 9i, 10G, 11G :- These are some combine feature which has differences among others. Automatic Workload Repository (AWR) Drop database' s

Adding Table Constraints ALTER TABLE ENROLMENT ADD CONSTRAINT NameNotNull CHECK (Name IS NOT NULL) ; ALTER TABLE ENROLMENT ADD CONSTRAINT PK_StudentId_CourseId PRIM

Character Types The Character types allow you to store alphanumeric data, represent words and text, and manipulate the character strings. CHAR You use the CHAR dataty

Truth Tables: However in propositional logic - here we are restricted to expressing sentences and where the propositions are true or false - so we can check where a particular

Joining in SQL Joining IS_CALLED and IS_ENROLLED_ON in SQL SELECT * FROM IS_CALLED NATURAL JOIN IS_ENROLLED_ON This is an example of an SQL table expression. I have been

Expressions   An expression is a randomly complex combination of the constants, variables, literals, operators, & function calls. The simplest expression is the single variabl

Rephrase Conditional Control Statements When computing a logical expression, the PL/SQL uses short-circuit evaluation. That is, the PL/SQL stops evaluating the expression as s

Predicate - SQL Consider the declarative sentence-a proposition-that is used to introduce this topic:  "Student S1, named Anne, is enrolled on course C1." Recall that th

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

Mixed Notation The fourth procedure call shows that you can mix the positional and named notation. In this situation, the first parameter uses the positional notation, & the s