PL/SQL Block Syntax and Guidelines
• Literals
– Character and date literals must be enclosed in single quotation marks.
v_name := ‘Henderson’;
– Numbers can be simple values or scientific notation.
• A slash ( /) runs the PL/SQL block in a script file or in some tools such as iSQL*PLUS.
Commenting Code
Prefix single-line comments with two dashes (–).
Place multiple-line comments between the symbols /*and */.
Convert the employee name to lowercase.
v_ename := LOWER(v_ename);
Data Type Conversion
• Convert data to comparable data types.
• Mixed data types can result in an error and affect performance.
• Conversion functions:
– TO_CHAR
– TO_DATE
– TO_NUMBER
DECLARE
v_date DATE := TO_DATE(’12-JAN-2001′, ‘DD-MON-YYYY’);
BEGIN