Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL : Alternative way of doing if any

Re: PL/SQL : Alternative way of doing if any

From: Billy <vslabs_at_onwe.co.za>
Date: 18 Aug 2005 22:52:54 -0700
Message-ID: <1124430774.003564.29350@g47g2000cwa.googlegroups.com>


Noel wrote:

> Baka's code will raise exception when, from some reason, cursor fail to
> open. No mysterious runtime errors occurs, there will be %NOTFOUND
> pseudocolumn of cursor set to TRUE if cursor fetches no records.

Bull! DBMS_OUTPUT does not have an infinite buffer size. What happens when the buffer gets full? And there is no ways that 4 lines of code for an getting a result into a variable is more sensible in this case than a single line.

> Your example might raise three kind of exception, no_data_found,
> too_many_rows and other exception, and you'll need to put some code for
> all of those.

Exactly. You do want the exceptions. You do want unhandled exceptions to be passed up the calling stack.

Do you actually know what exception handling is all about and what the differences are between dealing with exceptions via handlers and dealing with runtime errors using in-line IF block coding?

> I would stick by Baka's solution.

Solution!? That explains your comments. I honestly don't have the time or inclination to explain to you the very basics of programming. I suggest that you get yourself booked on a course that explains programming fundementals.

--
Billy
Received on Fri Aug 19 2005 - 00:52:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US