Home » SQL & PL/SQL » SQL & PL/SQL » exception handling
exception handling [message #358200] Mon, 10 November 2008 01:36 Go to next message
OracleDBA1
Messages: 7
Registered: November 2008
Junior Member
hello everyone,

i am running the Following peice of code:


declare
dbname v$database.name%type;
instno v$instance.instance_number%type;

...........
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('the database name');
dbms_output.put_line(dbname);
.........


now i am not able to get the database name in my output.

SQL> /

the database name

PL/SQL procedure successfully completed.


How do I do this?Please Help!! Smile


Thanks A LOT in advance.
Re: exception handling [message #358202 is a reply to message #358200] Mon, 10 November 2008 01:38 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Run this in SQL*Plus before you run your PL/SQL block
SET SERVEROUTPUT ON


Ross Leishman
Re: exception handling [message #358215 is a reply to message #358200] Mon, 10 November 2008 02:47 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Do you actually select v$database.name into your variable dbname at any point? Your example does not make this clear.
Previous Topic: Selecting uniquw Rows from Table contains duplicate rows.
Next Topic: Inline query with not exists clause
Goto Forum:
  


Current Time: Sun Dec 11 04:32:51 CST 2016

Total time taken to generate the page: 0.10316 seconds