Oracle PL/SQL - Using reserved word as a quoted user-defined identifier

Introduction

You can use a reserved word as a quoted user-defined identifier.

The following code declares quoted user-defined identifiers "BEGIN", "Begin", and "begin".

Although BEGIN, Begin, and begin represent the same reserved word, "BEGIN", "Begin", and "begin" represent different identifiers.

Demo

SQL>
SQL> DECLARE--  ww  w  .  j  a v a  2  s  .c  o m
  2    "BEGIN" varchar2(15) := 'UPPERCASE';
  3    "Begin" varchar2(15) := 'Initial Capital';
  4    "begin" varchar2(15) := 'lowercase';
  5  BEGIN
  6    DBMS_Output.Put_Line("BEGIN");
  7    DBMS_Output.Put_Line("Begin");
  8    DBMS_Output.Put_Line("begin");
  9  END;
 10  /
UPPERCASE
Initial Capital
lowercase

PL/SQL procedure successfully completed.

SQL>

Related Topic