Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PUZZLE: A call that succeeds N times then fails for any single connection
"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 % failluresReceived on Sat Apr 28 2007 - 07:03:25 CDT
![]() |
![]() |