Thanks to everybody, that fixed it.
Scott D. Adams
Database Administrator
-----Original Message-----
From: Justin Cave (DDBC)
[mailto:oracledba-ezmlmshield-x51980284.[Email address protected]
Sent: Tuesday, November 01, 2005 12:29 PM
To: LazyDBA Discussion
Subject: RE: PL/SQL Exception
Sure. You may have something like this
CREATE PROCEDURE dummy
AS
BEGIN
<<a bunch of SQL>>
BEGIN
SELECT ... INTO ...
EXCEPTION
WHEN no_data_found THEN
NULL; -- Ignore the no_data_found exception because ...
END;
<<more SQL>>
END;
You generally want the exception handler, particularly where you are
catching and ignoring the exception, to enclose the smallest amount of
SQL that would be appropriate. That way, your logic is more obvious--
someone who has to maintain the app can see that you expected a
particular SQL statement to sometimes find no data rather than wondering
which of dozens SELECT ... INTO statements in (or called by) the
procedure might fail. It prevents you from inadvertently handling
exceptions thrown in places you didn't expect-- nothing makes
maintenance harder than catching and ignoring exceptions unexpectedly.
Justin Cave
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC
-----Original Message-----
From: Adams Scott D. - G6
[mailto:oracledba-ezmlmshield-x9901839.[Email address protected]
Sent: Tuesday, November 01, 2005 12:23 PM
To: LazyDBA Discussion
Subject: RE: PL/SQL Exception
I have that at the bottom of my procedure now. I was just reading the
docs
and it mentioned enclosing the portion of the procedure that may cause
that
error inside its own begin/end. Does that make sense?
Scott D. Adams
Database Administrator
FORSCOM, G6
scott.[Email address protected]
(404) 464-5833
DSN 367-5833
-----Original Message-----
From: Justin Cave (DDBC)
[mailto:oracledba-ezmlmshield-x94600397.[Email address protected]
Sent: Tuesday, November 01, 2005 12:19 PM
To: LazyDBA Discussion
Subject: RE: PL/SQL Exception
BEGIN
SELECT ... INTO ...
EXCEPTION
WHEN no_data_found THEN
NULL;
END;
Justin Cave
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC
-----Original Message-----
From: Adams Scott D. - G6
[mailto:oracledba-ezmlmshield-x5634318.[Email address protected]
Sent: Tuesday, November 01, 2005 12:15 PM
To: LazyDBA Discussion
Subject: PL/SQL Exception
I have a procedure that has a section that could possibly return no data
found error. This is ok and expected. I would like to handle this in
the
exception portion of my procedure. I would like it to ignore that error
and
continue with the procedure. Any help would be greatly appreciated.
Scott D. Adams
Database Administrator
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page