11.2. Assignments and Statements

The assignment operator is:

":="

The assignment operator is not “=”, but the if-test expression is.

IF (a = b)

We do not code:

IF (a == b)

You can assign literal values, or expressions that include operations and other variables. You can wrap expressions provided the statement does not break in the middle of a variable name.

base_monthly_salary  := 10000;
base_salary_increase := 1000;
new_professor_salary := base_monthly_salary * 1.1;
new_profrssor_salary := base_monthly_salary +
                        base_salary_increase;

You can declare a variable with an initialized value. You can initialize it with NULL. Do not assume any initial value of a variable that is declared with no initial setting. You can declare an initialized ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.