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: PUZZLE: A call that succeeds N times then fails for any single connection

Re: PUZZLE: A call that succeeds N times then fails for any single connection

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sat, 28 Apr 2007 13:01:32 +0100
Message-ID: <d9OdnawpE9iZpa7bnZ2dnUVZ8tqinZ2d@bt.com>

"Mladen Gogala" <mgogala.SPAM_ME.NOT_at_verizon.net> wrote in message news:pan.2007.04.28.02.55.17_at_verizon.net...
> On Fri, 27 Apr 2007 07:55:20 +0100, Jonathan Lewis wrote:
>
>
>> create or replace package body fail_n as
>>
>> g_target number(10) := 3;
>> g_ct number(10) := 0;
>
> Jonathan, one question: why didn't you create a public package
> variable, in the package spec? Putting the counter in the package
> counter would give you more control as the counter would be adjustable
> from an anonymous block, outside the package?
>
> --
> http://www.mladen-gogala.com

Mladen,

No real reason - it's just some code I jotted down in a little less than 5 minutes so I wasn't planning for posterity.

With more time and a more thorough spec I might still have made the variables private to the package body, though, but then supplied a procedure and function to set the target , and report the current. (I might also have used number(N,0) for the two variables if I'd spent a moment more thinking about it).

-- 
Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html
Received on Sat Apr 28 2007 - 07:01:32 CDT

Original text of this message

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