Lexical units:
-Are building blocks of any PL/SQL block
-Are sequences of characters including letters, numerals, tabs, spaces, returns, and symbols
-Can be classified as:
Identifiers: v_fname, c_percent
Delimiters: ; , +, -
Literals: John, 428, True
Comments: --, /* */
valid in PL/SQL expressions:
single-row number and character functions,
data type conversion functions,
and date and time-stamp functions) are valid in PL/SQL expressions
not available in procedural statements:
DECODE
Group functions: AVG, MIN, MAX, COUNT, SUM, STDDEV, and VARIANCE
nested block:
-An executable section (BEGIN … END) can contain nested blocks.
-An exception section can contain nested blocks.
Nulls
Comparisons involving nulls always yield NULL.
Applying the logical operator NOT to a null yields NULL.
In conditional control statements, if the condition yields NULL, its associated sequence of statements is not executed.
Make code maintenance easier by:
-Documenting code with comments
-Developing a case convention for the code
-Developing naming conventions for identifiers and other objects
-Enhancing readability by indenting
Common function:
LENGTH();
MONTHS_BETWEEN(1,2);
CAST(1 AS TIMESTAMP);
Type Conversion:
– Implicit conversion (char/num | char/date)
– Explicit conversion
– TO_CHAR
– TO_DATE
– TO_NUMBER
– TO_TIMESTAMP