Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / PL SQL Data Types
 

Constants cannot be changed

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