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

Home -> Community -> Mailing Lists -> Oracle-L -> Literal SQL and sys.dual

Literal SQL and sys.dual

From: Mohammed Shakir <mshakir08816_at_yahoo.com>
Date: Tue, 02 Apr 2002 11:03:22 -0800
Message-ID: <F001.00439019.20020402110322@fatcity.com>


I am working on a database optimization project. My Shared pool is filled with SQL like

select 0 from dual;
select 1/1 from dual;
select 1 - 1/(2 + 2) from dual;

I tried to use the bind variables to minimize the literal SQL. However I need a different SQL script for each case.

select :b1 from dual;
select :b1/:b2 from dual;
select :b1 - :b2/(:b3 + :b4) from dual;

first one will handle all cases for b1 from 0 to any number which is good. And second sql will handle all the cases for any number for b1 and b2. So I do reduce the literal SQL. However, I need to know ahead of time what type of data I am calculating and then use the appropriate SQL. I think the easy solution would be to use arithmetic. That is to pass the string like ( 1 + 1 / (2 -2) ) to some function that can return me the result of this sting. So I would not be using SQL script, to minimize SQL execution, sys.dual contention or literal SQL filling shared pool and causing both library cache and shared pool. Not to mention saving in CPU processing by not parsing SQL scripts.

Anybody, aware of such function in PL/SQL? Is there any other way to do calculations other than 'select 1 + 1 from dual' ?

I would really appreciate if you could let me know.

Thanks

Mohammed Shakir



Mohammed Shakir
CompuSoft, Inc.
11 Heather Way
East Brunswick, NJ 08816-2825
(732) 672-0464 (Cell)
(732) 257-6001 (Home)


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax http://http://taxes.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mohammed Shakir
  INET: mshakir08816_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Tue Apr 02 2002 - 13:03:22 CST

Original text of this message

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