Solved

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

Posted on 2001-07-17
3
1,541 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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
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…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

867 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

15 Experts available now in Live!

Get 1:1 Help Now