Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Stewart Chew
  Where is Stewart Chew?
 
 Malaysia
 Stewart Chew
 To: tushar
  Where is tushar?
 Panaji
 India
 tushar
 Tags
Subject: RE: Insert & Update records
Thread ID: 145129 Message ID: 145159 # Views: 38 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, September 13, 2007 11:33:53 AM         
   


> Stewart
>
> How many records are there in cWrkOrdr and how long does it take.
>
> Instead of putting some conditions in the WHERE, I think you can put them in the JOIN
> Like
> UPDATE mrs_dtl SET tl_rtn = cWrkOrdr.rtn_qty;
> FROM mrs_dtl;
> INNER JOIN cWrkOrdr ON mrs_dtl.mrs_no = cWrkOrdr.mrs_no;
> WHERE cWrkOrdr.part_code = mrs_dtl.son_code;
> AND cWrkOrdr.prd_ordr = mrs_dtl.prd_ordr;
> AND cWrkordr.rtn_qty > 0
> can be
> UPDATE mrs_dtl SET tl_rtn = cWrkOrdr.rtn_qty;
> FROM mrs_dtl;
> INNER JOIN cWrkOrdr ON mrs_dtl.mrs_no = cWrkOrdr.mrs_no;
> AND cWrkOrdr.part_code = mrs_dtl.son_code;
> AND cWrkOrdr.prd_ordr = mrs_dtl.prd_ordr;
> WHERE cWrkordr.rtn_qty > 0
>
> You should have all the required indexes in place whereever you have the "=" sign.
>
> in mrs_dtl you need indexes on son_code, prd_ordr, mrs_no
> in cWrkOrdr you need it on part_code, prd_ordr, mrs_no, rtn_qty
>
> Also you can enclose everything in a BEGIN TRANSACTION / END TRANSACTION.
>
> HTH
>
> Regards
> Tushar
>
>
Dear Expert,

Can you give some example? I'm not familiar to use BEGIN TRANSACTION / END TRANSACTION.

Thanks.

Regards,

Stewart Chew



COMPLETE THREAD
Insert & Update records Posted by Stewart Chew @ 9/13/2007 8:47:55 AM
RE: Insert & Update records Posted by tushar @ 9/13/2007 10:12:55 AM
RE: Insert & Update records Posted by Stewart Chew @ 9/13/2007 11:33:53 AM
RE: Insert & Update records Posted by Ken Murphy @ 9/13/2007 12:40:19 PM
RE: Insert & Update records Posted by Stewart Chew @ 9/18/2007 3:54:33 AM
RE: Insert & Update records Posted by tushar @ 9/18/2007 11:44:22 AM
RE: Insert & Update records Posted by Ken Murphy @ 9/18/2007 2:12:41 PM
RE: Insert & Update records Posted by Stewart Chew @ 9/19/2007 2:39:21 AM
RE: Insert & Update records Posted by Ken Murphy @ 9/19/2007 2:55:43 PM
RE: Insert & Update records Posted by Stewart Chew @ 9/20/2007 4:18:16 AM
RE: Insert & Update records Posted by Ken Murphy @ 9/20/2007 1:45:31 PM
RE: Insert & Update records Posted by Cetin Basoz @ 9/20/2007 2:05:02 PM
RE: Insert & Update records Posted by Ken Murphy @ 9/20/2007 2:14:16 PM
RE: Insert & Update records Posted by Cetin Basoz @ 9/20/2007 2:26:32 PM
RE: Insert & Update records Posted by Ken Murphy @ 9/20/2007 2:43:10 PM
RE: Insert & Update records Posted by Cetin Basoz @ 9/20/2007 2:00:53 PM