QuestionQ52

VerifiedPL/SQL Language Fundamentals

Examine this statement, which executes successfully:

SQL> SET SERVEROUTPUT ON;  

Now examine the following code, which is executed:

Question Image

What is true about the result?

Explanation

A PL/SQL scalar variable declared with NOT NULL must be initialized in its declaration, because scalar variables otherwise default to NULL. v_deptno NUMBER(2) NOT NULL; lacks that required initialization, causing a compilation error on line 4.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!