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: Charely <nospam_at_skynet.be>
Date: Sat, 28 Apr 2007 14:03:25 +0200
Message-ID: <463337e2$0$14247$ba620e4c@news.skynet.be>

"joeNOSPAM_at_BEA.com" <joe.weinstein_at_gmail.com> wrote in message news:1177642861.896868.282260_at_b40g2000prd.googlegroups.com...
> Hi all. I want some parameter-less SQL or procedure that will run
> uneventfully N times for any given DBMS connection, but will then
> *fail* such that the caller gets some ORA-XXXXXX error. I would
> like this as light-weight and quick as possible. Much thanks in
> advance for any cool ideas.
> Joe Weinstein at BEA Systems
>

if you want to add some true (pseudo) randomness to the failure pattern you can use

  select 1/decode(least(dbms_random.normal(),1.96),1.96,0,1) from dual

  a value of 1.96 will give 2.5 % failures.   Some other values

   1.645 : 5% failures

   1         :  16 % failures
    0        :  50 % faillures

 
Received on Sat Apr 28 2007 - 07:03:25 CDT

Original text of this message

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