× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ummm. Doesn't the "where rrn(a") preclude the use of an index, always causing a table scan? Or did something change on a recent release?

Sam

On 6/22/2010 4:19 PM, Kurt Anderson wrote:
I have a procedure in a service program that I'd like to change to use SQL, but I can't seem to get my finger on how the index should look so the optimizer picks it up. Here is the SQL in the procedure. The select is actually a part of a declare. I'm fetching 250 rows at a time, and updating every row.

Select Cust#, CalDte, Pac#, Dept#, CalTyp, DstFlg, BAmt, DspQty,
Loc#, PrtFlg, SvPrtFlg, RRN(a)
From CdrMstP a
Where Cust# = :Cust# and CalDte<= :CutOff
and StmDte = '0001-01-01'
Order By Cust#, CalDte;

Update CdrMstP a
Set StmDte = :StmtDate,
Corp# = :Corp#,
Loc# = :ds_CdrOut.Loc#,
Dept# = :ds_CdrOut.Dept#,
PrtFlg = :ds_CdrOut.PrtFlg,
SvPrtFlg = :ds_CdrOut.SvPrtFlg
where rrn(a) = :ds_CDROut.CdrRRN;

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.