Introduction to PL/SQL (Lexical Units & Operator)

Lexical Units: Lexical units include letters, numerals, special characters, tabs, spaces, returns and symbol that building a PL/SQL block. Lexical unit can classified as following…

  • Identifier
  • Delimiters
  • Literals
  • Comments

Identifier: Identifier are the names given to PL/SQL objects.
Quoted Identifier: Quoted identifier makes identifier case sensitive, include character such as space and use reserved words. example-

“begin date” DATE;
“end adte” DATE;

Delimiters: Delimiters are symbols that have special meaning. I know you have already learned about that the semicolon (;) is used to terminate a SQL & PL/SQL statement. Therefore, (;) is the best example of a delimiters. A list of delimiters are following-

Symbol Meaning
+ Addition Operator
Subtraction/Negation Operator
* Multipluication Operator
/ Division Operator
= Equalty Operator
@ Remote access indicator
; Statement Terminator
<> Inequality Operator
!= Inequality Operator
|| Concatention Operator
Single line Comment ondicator
/* Beginning Comments Indicator
*/ Ending Comment Indicator
:= Assignment Operator

Literals: Any value that is assigned to a variable is a literal. Any character, numeral, boolean or date value that is not an identifier is a literal. Literal can classified as …
1. Character Literal : Such as – Asgor, 124c, 11-jan-2014
2. Numeric Literal : Such as – 51478, 45.457
3. Boolean Literal : TRUE, FALSE and NULL is boolean literals.

Comments: It is good programming practice to explain what a piece of a code is trying to achieve. When you include the explanation in a PL/SQL block, the compiler cannot interpret these instruction. Comments are given by the …

– Two hyphen (–) are used to single line comment.
– The beginning and ending comments delimiters (/* and */) are used to comments multiple lines.