Go Premium for a chance to win a PS4. Enter to Win

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,614 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 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

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…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
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.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Suggested Courses

916 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