Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Help Needed to Speed Up the code
Message
From
30/07/2013 13:00:14
 
 
To
30/07/2013 10:45:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01579372
Message ID:
01579460
Views:
74
>Instead, If I try this code it seems to work some faster
>
>Update New_bills Set Exchange=(Select Exchange From Master Where Master.Accountno=New_bills.filename) and after getting the name of exchange in My New_bills I will Update Newpath.
>
>But the problem using the above command is that I get NULL Values in the field exchange for the filename with are not accountno in Master.dbf, Instead of NULL Values I need 'MISSING EXCHANGE'.
>
>I.e for the values for which there is match I need the proper exchange code and for which there is no match I need 'Missing exchange'
>
>The SQL code which you provided earlier perhaps dont take E into consideration. E=ALLTRIM(Exchange) in my origininal code.
>

Yes, I failed to notice that you were actually using the value of E. Not difficult to change the code I gave you, though:

>cPath = ADDBS(tDirectory+pBillmonth+'-'+ALLTRIM(STR(pbillyear)))
* Handle the ones that match first.
UPDATE NewBills ;
  SET MissExg = 1, ;
          NewPath = FORCEPATH(FORCEEXT(FileName, "PS")+"\" + ALLTRIM(Master.Exchange), m.cPath) ;
  FROM Master ;
  WHERE NewBills.FileName = Master.AccountNo

* Handle the ones with no match.
UPDATE NewBills ;
  SET MissExg = 0, ;
          NewPath = "Missing Exchange";
  WHERE FileName NOT IN (SELECT AccountNo FROM Master)
Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform