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: Are these SQL statements equivalent?

Re: Are these SQL statements equivalent?

From: Ed Prochak <ed.prochak_at_magicinterface.com>
Date: Tue, 28 Jun 2005 23:24:35 -0400
Message-ID: <e58e2$42c21276$471d7821$3061@ALLTEL.NET>


deanbrown3d wrote:

> If I have a SQL statement:
>
> -----------------------------------------------------
> update TRAIN_ROUTE_MQ TRMQ
> set (TRAIN_I, P_VERSION_I) =
> (
> select TRAIN_I, P_VERSION_I
> from TRAIN_MQ MQ
> where MQ.TRAIN_IMP_I = TRMQ.TRAIN_IMP_I
> and MQ.LOCKED_PROJECT_I = " + XXXXXXXXXXXXXX
> )
> where TRMQ.LOCKED_PROJECT_I = iCurrentProject;
> -----------------------------------------------------
>
> Is there any difference between setting the XXXXXXXXXXXXXX to:
>
> iCurrentProject
>
> or
>
> TRMQ.LOCKED_PROJECT_I
>
> Thanks for any info,
>
> Dean
>

Did you check the EXPLAIN PLAN for each version?

I'm guess that using the iCurrentProject would be more efficient but not really sure. I could maybe argue either way, but it's the optimiser that has the final say.

-- 
Ed Prochak
running    http://www.faqs.org/faqs/running-faq/
netiquette http://www.psg.com/emily.html
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Tue Jun 28 2005 - 22:24:35 CDT

Original text of this message

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