Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: "Not in" subquery
On Jun 6, 2:06 pm, Amritha.Da..._at_gmail.com wrote:
> On Jun 6, 4:57 pm, "fitzjarr..._at_cox.net" <fitzjarr..._at_cox.net> wrote:
>
>
>
>
>
> > On Jun 6, 3:52 pm, Amritha.Da..._at_gmail.com wrote:
>
> > > On Jun 6, 4:47 pm, "fitzjarr..._at_cox.net" <fitzjarr..._at_cox.net> wrote:
>
> > > > On Jun 6, 3:43 pm, Amritha.Da..._at_gmail.com wrote:
>
> > > > > On Jun 6, 4:31 pm, "fitzjarr..._at_cox.net" <fitzjarr..._at_cox.net> wrote:
>
> > > > > > On Jun 6, 3:22 pm, Amritha.Da..._at_gmail.com wrote:
>
> > > > > > > Hello,
>
> > > > > > > Is there any alternative query to the below one?
>
> > > > > > > update RTable set Reason = "XYZ"
> > > > > > > Where FKey = 1234
> > > > > > > and SFKey = 1
> > > > > > > and Reason Is Null
> > > > > > > and F_ID not in ( Select F_ID from RTable
> > > > > > > Where FKey = 1234
> > > > > > > and SFKey = 1
> > > > > > > and TO_NUMBER(REL_CD) = 1
> > > > > > > and Reason Is Null);
>
> > > > > > > "not in" in the above query is taking alot of time and it is timing
> > > > > > > out.
>
> > > > > > > Please Advise.
See http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:953229842074
...
>
> Being a developer I can not have access to generate DDL.
> But As explained I will be executing this SQL through a stored
> procedure to update
> reason code for the qualified records in the sub query.
>
> Please advise.
>
> Thanks
Any developer should know how to check the plan for their code. See http://www.jlcomp.demon.co.uk/explain_1_i.html and http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:231814117467
Also see http://www.dbaoracle.net/readme-cdos.htm
jg
-- @home.com is bogus. "I was repeatedly told I was not contagious, that I was not a threat to anyone." - Andrew SpeakerReceived on Wed Jun 06 2007 - 16:32:34 CDT