RelationalDBDesign
RedhatLinuxSys Seomining
prev next prev next
  Course navigation
 
Lesson 4
Objective
What are identifiers and literals?
Place identifiers and use literals within a PL/SQL block.
   
In PL/SQL, identifiers are used as variable names. The identifiers must follow the following naming conventions:
  1. An identifier must be less than or equal to 30 characters in length.
  2. An identifier must begin with a letter, and can be followed by any combinations of letters, numbers, and the characters $, _, and #.
  3. An identifier cannot be a reserved word unless it is enclosed within double quotes.
  4. Case does not matter for the identifier unless the identifier is enclosed in double quotes.
Scope of an identifier
The scope of an identifier is that section of a program unit (block, subprogram, package) from which the identifier is referenced. Identifiers declared within a block are considered local to that block and global to all its nested blocks.
Global identifiers can be redeclared within a nested block, in which case the local declaration prevails. The nested block cannot reference the global identifier unless a qualified name is used. The qualifier can be the name of an enclosing subprogram or the label of an enclosing block.
Literals
A literal is an explicit numeric, character, string, or boolean value not represented by an identifier. Let’s try to understand each type of literal with the help of the following SlideShow.
Image
PL SQL Identifiers Literals
PL/SQL is case sensitive within string literals.

In the next lesson, adding comments to a PL/SQL block will be discussed.
  Course navigation