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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help! Question on PL/SQL

Re: Help! Question on PL/SQL

From: <jeanch_at_my-deja.com>
Date: Fri, 21 Jan 2000 14:46:10 GMT
Message-ID: <869rfd$2a1$1@nnrp1.deja.com>


In article <3887b98a_at_news.cyberzone.net>,   "bejones" <bejones_at_cyberzone.net> wrote:
> In you example you create temp1 and temp2 so that the third query can
join
> the two temp tables. This type of operation is done in SQL SERVER for
> performance reason and is not necessary in Oracle.
>
> This is a habit you must break now that you are using a real database.
>
> Dana Jian wrote in message <38872dc8$0$89858_at_news.choice.net>...
> >Hi,
> >
> >I'm converting one procedure from SQL server to Oracle procedure.
> >
> >Here's the simplified statements in the SQL proc,
> >
> >SELECT ... INTO #temp1 FROM....WHERE..
> >
> >SELECT ... INTO #temp2 FROM... WHERE
> >
> >SELECT ... FROM #temp1, #temp2 , .... WHERE ...
> >
> >How to do this in Oracle PL/SQL?
> >
> >Any comments/help will be highly appreciated!!
> >
> >Dana
> >djian_at_trasa.com
> >
> >
> >
> >
> Hiya,

Please stay away from temporary table if at all possible (I've burnt by it)
Instead use things like

select ... from tab1 where ...
UNION or UNION ALL
select ... from tab2 where ...

even smarter...

select name from worker
where name IN (select name from contractor) UNION
(select name from permanent)

Hope this helps

Cheers
JC

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Jan 21 2000 - 08:46:10 CST

Original text of this message

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