Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Help Needed to Speed Up the code
Message
De
02/08/2013 09:07:40
 
 
À
01/08/2013 14:50:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01579372
Message ID:
01579736
Vues:
65
>Thanks for the explaination but again, I am not exactly looking for the code you expained. Perhaps I am not able to express, what I am exactly asking.
>That Match Filename is equal to Accountno is fine but where filename is not equal to accountno, I need differrent as explained below.
>I have tables Master.DBF and a temporary cursor New_bills.
>On the form the user 1st select Month and the Year and than the user clicks on a command button and selects the Target Path i.e the path where the files are to be copied. I have used GETDIR() for this.
>Now suppose, the user selects
>
>Combo1=July, Combo2=2013 and GETDIR()='C:\BILLS'
>So, My cPath becomes
>cPath = ADDBS(tDirectory+pBillmonth+'-'+ALLTRIM(STR(pbillyear))).
>
>
>Uptill here every thing is fine.
>Now I have suppose A, B, C, & D as FOUR Distinct Exchanges in Master.DBF,Taking the above Four exchanges My program creates FIVE Sub directories under cPath
> A, B , C , D and an addtional 'MISSING EXCHANGE'
>
>Now, I have to insert the new paths of Filename, filename is 10 Digit feild containing the names of files without extension Where New_bills.Filename is equal to Master.Account Number. I need to copy that path as Cpath plus the Corresponding exchange(A B C or D) and Where New_bills.Filename is not equal to Master.Account Number my newpath shall be Equal to 'C:\Bills\July-2013\Missing Exchnage\1234567899.ps
>
>Mean to say that if the new_bills.Filename=Master.Accountno
>
>
>
>Newpath=C:\Bills\July-2013\C\1234567899.ps. Suppose C is the corresponding exchage
>and if new_bills.Filename<>Master.Accountno
>Newpath=C:\Bills\July-2013\Missing Exchange\1234567899.ps
>Please Note That "Missing Exchange" is NOT in the DISTINCT list of Master.Exchange
>I tried to change your code, but could not get through. here is what i tried for those that DOES NOT MaTCH
>
>
>cPath = ADDBS(tDirectory+pBillmonth+'-'+ALLTRIM(STR(pbillyear)))+'Missing Exchange'
>
>* Handle the ones with no match.
>UPDATE NewBills ;
>  SET MissExg = 0, ;
>          NewPath = FORCEPATH(FORCEEXT(Filename, "PS")+"\" , m.cPath)  ;
>  WHERE FileName NOT IN (SELECT AccountNo FROM Master)
>
>
>I am not having problem with the ones where Filename=Accountno. that code is working fine
>

Didn't the second query in that set work for this case. This one:
* Handle the ones with no match.
UPDATE NewBills ;
  SET MissExg = 0, ;
          NewPath = FORCEPATH(FORCEEXT(Filename, "PS")+"\" , m.cPath)  ;
  WHERE FileName NOT IN (SELECT AccountNo FROM Master)
This finds all the records in NewBills that don't have a matching record in Master. Isn't that what you want?

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform