This script demonstrates constants : Constant Number « PL SQL « Oracle PL / SQL






This script demonstrates constants

   
SQL>
SQL>
SQL> SET SERVEROUTPUT ON
SQL>
SQL>
SQL> DECLARE
  2      fnameValue CONSTANT VARCHAR2(50) := 'Ron';
  3   BEGIN
  4      fnameValue := 'AAA';
  5   EXCEPTION
  6      WHEN OTHERS
  7      THEN
  8         DBMS_OUTPUT.PUT_LINE(SQLERRM);
  9   END;
 10   /
    fnameValue := 'AAA';
    *
ERROR at line 4:
ORA-06550: line 4, column 5:
PLS-00363: expression 'FNAMEVALUE' cannot be used as an assignment target
ORA-06550: line 4, column 5:
PL/SQL: Statement ignored


SQL>

   
    
    
  








Related examples in the same category

1.Declare initialized constant number
2.Change constant number
3.you must initialize the constant at the time of declaration
4.declare number constant uninitialized