Table of Contents Previous Next


4 Stored Procedure Language : 4.1 Basic SPL Elements

SPL programs are written using the following set of characters:
Uppercase letters A thru Z and lowercase letters a thru z
Digits 0 thru 9
Symbols ( ) + - * / < > = ! ~ ^ ; : . ' @ % , " # $ & _ | { } ? [ ]
Note: The data that can be manipulated by an SPL program is determined by the character set supported by the database encoding.
Keywords and user-defined identifiers that are used in an SPL program are case insensitive. So for example, the statement DBMS_OUTPUT.PUT_LINE('Hello World'); is interpreted to mean the same thing as dbms_output.put_line('Hello World'); or Dbms_Output.Put_Line('Hello World'); or DBMS_output.Put_line('Hello World');.
Character and string constants, however, are case sensitive as well as any data retrieved from the Advanced Server database or data obtained from other external sources. The statement DBMS_OUTPUT.PUT_LINE('Hello World!'); produces the following output:
However the statement DBMS_OUTPUT.PUT_LINE('HELLO WORLD!'); produces the output:
Identifiers are user-defined names that are used to identify various elements of an SPL program including variables, cursors, labels, programs, and parameters.
The syntax rules for valid identifiers are the same as for identifiers in the SQL language. See Section 3.1.2 for a discussion of SQL identifiers.
An identifier must not be the same as an SPL keyword or a keyword of the SQL language. The following are some examples of valid identifiers:
A qualifier is a name that specifies the owner or context of an entity that is the object of the qualification. A qualified object is specified as the qualifier name followed by a dot with no intervening white space, followed by the name of the object being qualified with no intervening white space. This syntax is called dot notation.
qualifier. [ qualifier. ]... object
qualifier is the name of the owner of the object. object is the name of the entity belonging to qualifier. It is possible to have a chain of qualifications where the preceding qualifier owns the entity identified by the subsequent qualifier(s) and object.
As a general rule, wherever a name appears in the syntax of an SPL statement, its qualified name can be used as well. Typically a qualified name would only be used if there is some ambiguity associated with the name. For example, if two procedures with the same name belonging to two different schemas are invoked from within a program or if the same name is used for a table column and SPL variable within the same program.
All variables declared in the declaration section of an SPL program are prefixed by v_. E.g., v_empno
4.1.5 Constants
Constants or literals are fixed values that can be used in SPL programs to represent values of various types - e.g., numbers, strings, dates, etc. Constants come in the following types:
Numeric (Integer and Real) – see Section 3.1.3.2 for information on numeric constants.
Character and String – see Section 3.1.3.1 for information on character and string constants.
Date/time – see Section 3.2.4 for information on date/time data types and constants.

4 Stored Procedure Language : 4.1 Basic SPL Elements

Table of Contents Previous Next