Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PERVASIVE.SQL COMMANDO SYNTAX

Status
Not open for further replies.

GigiClippy

Programmer
Apr 17, 2009
2
0
0
MX
Hi
I'm MAX user and
I try to do a query for update any records of the Part Master table, just need to update the field MATL_01 (with a new cost for new exchange rate) but just the records with the condition that this part has a currency in USD
This information included in the table Part Vendor and Vendor Master
The Query is:
UPDATE "Part Master"
SET MATL_01=ROUND((ROUND((COST_01/14.5284),4)*14.7032),5)
FROM ("Part Vendor" "PV" INNER JOIN "Part Master" "PM" ON "PV"."PRTNUM_07"="PM"."PRTNUM_01") INNER JOIN "Vendor Master" "VM" ON "PV"."VENID_07"="VM"."VENID_08"
WHERE "PM"."TYPE_01"='B' AND "VM"."CURR_08"='USD'

The error is:
Syntax Error: UPDATE "Part Master"
SET MATL_01=ROUND((ROUND((COST_01/14.5284),4)*14.7032),5)
FROM<< ??? >> ("Part Vendor" "PV" INNER JOIN "Part Master" "PM" ON "PV"."PRTNUM_07"="PM"."PRTNUM_01") INNER JOIN "Vendor Maste

I'm use the Pervasive.SQL datamanager
Anybody helps me for fix this query?
Thanks in advanced for your recommendation
Regards
 
It might not like the inner join - I recently had trouble with V8 doing an update with a join. Try converting your INNER JOIN to a WHERE clause. Something like:

UPDATE "Part Master"
SET MATL_01=ROUND((ROUND((COST_01/14.5284),4)*14.7032),5)
WHERE ("Part Vendor"."PRTNUM_07"="Part Master"."PRTNUM_01") AND "Part Vendor"."VENID_07"="Vendor Master"."VENID_08" AND
"Part Master"."TYPE_01"='B' AND "Vendor Master"."CURR_08"='USD'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top