Re: avoid dynamic SQL
Date: Tue, 30 Jun 2009 11:11:24 +0200 (CEST)
Message-ID: <61819.213.162.65.111.1246353084.bloek_at_pwebmail6.utanet.at>
Hi Alex,
> the formulas are such as
>
> 1/1+2+3+4+5+6+7
> 2/5+43+434+33+22
> 1
> 2+3+4+4
>
>
> The shared pool is full of BEGIN :EXITCODE statements and is causing
> ORA-4031 :-[
>
You may try to limit the nuber of the dynamic SQL's using a bulk evaluation.
Something like this (pseudocode)
EXECUTE IMMEDIATE 'insert into result
select 'formula1' , 1/1+2+3+4+5+6+7 from dual union all
'formula2' , 2/5+43+434+33+22 from dual union all
...
You may limit the number of cursors significantly generating e.g. 100
formulas in one statement.
The downside is that the error handling is a bit complicated.
Of course an other possibility is to calculate the results out of the database using some language that support eval natively.
regards,
Jaromir
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Jun 30 2009 - 04:11:24 CDT