Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Full Optimize this
Message
De
07/03/2013 07:58:45
Mk Sharma
Shrishti Solutions
Mumbai, Inde
 
 
À
07/03/2013 07:56:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01567687
Message ID:
01567701
Vues:
40
Thank you,

I think someone told me to avoid macro, so i asked the alternate ?

Warm regards,
mk.

>Use it as it is, no gain in changing.
>
>>Thank you,
>>
>>I have changed like below :
>>
>>
>>Do Case
>>        Case Thisform.Optiongroup1.Value = 1   &&  All Records
>>		Thisform._lcliftdate = ".T."
>>	Case Thisform.Optiongroup1.Value = 2   &&  Only Pending Records
>>		Thisform._lcliftdate = "liftdate == {}"
>>	Case Thisform.Optiongroup1.Value = 3   &&  Only Final Records
>>		Thisform._lcliftdate = "liftdate <> {}"
>>Endcase
>>
>>
>>
>>What alternate we can use for " &lcLiftcond " ?
>>
>>Warm Regards,
>>mk.
>>
>>
>>>Assuming that lcliftdate is a date. If not, adjust acccordingly
>>>
>>>Do Case
>>>        Case Thisform.Optiongroup1.Value = 1   &&  All Records
>>>		Thisform._lcliftdate = ".T."
>>>	Case Thisform.Optiongroup1.Value = 2   &&  Only Pending Records
>>>		Thisform._lcliftdate = "liftdate == {}"
>>>	Case Thisform.Optiongroup1.Value = 3   &&  Only Final Records
>>>		Thisform._lcliftdate = "not liftdate == {}"
>>>>Endcase
>>>
>>>
>>>Another option to try, run first select w/o additional condition. After that use the cursor created as source for the second select with the additional condition.
>>>
>>>>How to Full optimize below Select - sql ?
>>>>
>>>>
>>>>clear 
>>>>Local lcLiftcond
>>>>Close Databases All
>>>>Use 1001\psaudac In 0
>>>>Use 1001\psaudam In 0
>>>>Use 1001\customer In 0
>>>>Use 1001\pcode1 In 0
>>>>
>>>>lcLiftcond = '.T.'
>>>>
>>>>Do Case
>>>>        Case Thisform.Optiongroup1.Value = 1   &&  All Records
>>>>		Thisform._lcliftdate = ".T."
>>>>	Case Thisform.Optiongroup1.Value = 2   &&  Only Pending Records
>>>>		Thisform._lcliftdate = "empty(liftdate)"
>>>>	Case Thisform.Optiongroup1.Value = 3   &&  Only Final Records
>>>>		Thisform._lcliftdate = "not empty(liftdate)"
>>>>Endcase
>>>>
>>>>lcLiftcond = Thisform._lcliftdate
>>>>
>>>>= Sys(3054, 1)
>>>>
>>>>
>>>>Select 0
>>>>Select ;
>>>>		Str(Val(psaudam.saudano), 10) As dono, ;
>>>>		godown.acname As locname, ;
>>>>		party.acname As acname, ;
>>>>		pcode1.wood As prodname, ;
>>>>		mill.acname As millname, ;
>>>>		psaudac.Lotno, ;
>>>>		psaudac.Bags, ;
>>>>		psaudac.Weight, ;
>>>>		psaudac.liftdate, ;
>>>>		psaudac.Rem1, ;
>>>>		psaudac.Childid ;
>>>>	From psaudam ;
>>>>	Left Outer Join customer godown ;
>>>>		On godown.accode = psaudam.loccode ;
>>>>	Left Outer Join customer party ;
>>>>		On party.accode = psaudam.accode ;
>>>>	inner Join psaudac ;
>>>>		On psaudac.Masterid = psaudam.Masterid ;
>>>>	Left Outer Join pcode1  pcode1 ;
>>>>		On pcode1.pcode = psaudac.pcode ;
>>>>	Left Outer Join customer mill ;
>>>>		On mill.accode = psaudac.millcode ;
>>>>	Where psaudam.trnstatus = 'YO' ;
>>>>		And &lcLiftcond ;
>>>>	Order By 1 ;
>>>>	Into Cursor junk1 Readwrite
>>>>
>>>>**  if i remove below code then it is fully optimized, but how to optimize including below code
>>>>*		And &lcLiftcond ;
>>>>
>>>>
>>>>
>>>>What alternate we can use for " And &lcLiftcond " ?
>>>>
>>>>Warm Regards,
>>>>mk.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform