Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2001-07-17
3
Medium Priority
?
1,598 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 20 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

722 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