Tuesday, 22 May 2012

Does a NOT NULL constraint of a database column apply to %TYPE variables? | PL SQL

 No, a NOT NULL constraint does not apply to variables declared using the %TYPE attribute. These variables can be assigned a null value in a PL/SQL block, as shown in the following code snippet:
 DECLARE
 var_emp_code t_employee.emp_code%TYPE;
 .....
 BEGIN
var_emp_code := NULL;

No comments: