Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating from multiple tables
Message
From
16/10/2002 11:02:39
 
 
To
16/10/2002 10:42:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00711730
Message ID:
00711746
Views:
14
This message has been marked as the solution to the initial question of the thread.
UPDATE doesn't support a FROM and a INNER JOIN clause. You can use a work around:
SELECT a_prempt.prempl, a_prempl.regpay;
   FROM a_prempt;
   INNER JOIN a_prpay;
      ON a_prpay.paytype = a_prempt.paytype;
   INNER JOIN a_prempl;
      ON a_prempt.prempl = a_prempl.prempl;
   WHERE a_prempt.emprate AND;
      a_prpay.payclass LIKE "%REGULAR%";
   INTO CURSOR Temp

SCAN
   UPDATE a_prempt SET a_prempt.payrate = Temp.regpay WHERE a_prempt.prempl = Temp.prempl
ENDSCAN

USE IN Temp
HTH

>I am having trouble finding the correct code to update from multiple tables. I am afraid that the SQL commands I am trying do not work on a FoxPro database. The commands I am using are as follows:
>UPDATE a_prempt;
> SET payrate = a_prempl->regpay ;
>FROM a_prempt ;
>INNER JOIN a_prpay ;
> ON a_prpay->paytype = a_prempt->paytype ;
>WHERE a_prempt->prempl = a_prempl->prempl ;
> AND a_prempt->emprate = .t. ;
> AND a_prpay->payclas like "%REGULAR%"
>
>Is there a way in FoxPro that I can write a similiar update statement. Every way I have tried won't compile due to errors. If it helps, the compilation errors occur on the "From" line. Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform