| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to avoid a temporary table
Peter Mutsaers wrote:
>Hello,
>
>Often I have seen opinions in this group that temporary tables are not
>necessary and can always be avoided. I don't like (the oracle way of)
>temporary tables and would like to avoid them, if possible. However I
>feel that often they are unavoidable in order to "modularize" SQL,
>i.e. avoid multiple occurrance of similar pieces of SQL.
>
>I know that you can always rewrite a temporary table as a subquery.
>Often however, you end up using multiple subqueries that are very
>similar, i.e. duplication of "code", that you avoid in "normal"
>programming languages by using subfunctions that calculate
>intermediate results and store these.
>
>Am I missing some approach or method to avoid code duplication without
>resorting to temporary tables?
>
>
My sense, after more than 30 years in this business, is that your
response to Oracle
temporary tables is more driven by a lack of understanding Oracle than
anything else.
Temporary tables are almost always unnecessary and when the are required
the Oracle
temporary tables are a far more efficient solution than performing DDL
on-the-fly.
Why don't you post the issue and let us take a look at it.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Thu Oct 23 2003 - 15:20:48 CDT
![]() |
![]() |