Solved

What is the output of the sample code above, assuming SERVEROUTPUT is set ON?

Posted on 2001-07-17
3
1,534 Views
Last Modified: 2006-11-17
my_table

Name  Null?     Type          Constraint
----  --------  ------------  -----------
ID    NOT NULL  NUMBER        PRIMARY KEY
NAME            VARCHAR2(20)

DECLARE
  ln_id   my_table.id%TYPE;

  -- Define exception for NOT NULL error.
  missing_value EXCEPTION;
  PRAGMA EXCEPTION_INIT(missing_value,-1400);
 
BEGIN
  ln_id := NULL;

  DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(ln_id),'NULL'));

EXCEPTION

  WHEN VALUE_ERROR THEN
     DBMS_OUTPUT.PUT_LINE('Value Error');

  WHEN missing_value THEN
     DBMS_OUTPUT.PUT_LINE('Missing Value');

END;  
  What is the output of the sample code above, assuming SERVEROUTPUT is set ON?  
Choice 1  
 Value Error  
Choice 2  
 Missing Value  
Choice 3  
 0  
Choice 4  
 NULL  
Choice 5  
 The code will not compile.  
0
Comment
Question by:Daman
3 Comments
 
LVL 2

Expert Comment

by:RMZ
ID: 6292619
[modder]
0
 

Expert Comment

by:Vidyadhars
ID: 6292813
[modder]
0
 
LVL 3

Accepted Solution

by:
modder earned 5 total points
ID: 6292966
Hello Daman

I would like to point you to the member agreement. You can find a link to that on the bottom of every page.

Specifically the Guidelines for use, in which it states that Experts Exchange shall not be used for

* violating the guidelines for academic honesty or other unethical behavior.

In other words:

Experts-Exchange is not a homework service. Please stop using it for this purpose.

And everyone, please stop providing assistance for this violation. As you can see you will not get any points for your help.

modder
Community Support Moderator@Experts-Exchange
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to recover a database from a user managed backup

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now