General information
Title:
Updating a table from an SQL view?
Hi,
I would like to code the sending of updates from a SQL view to a base table named Invoice, whose primary key is ID.
I can't get the updates to work, smoothly. I get several error messages, one of which is:
"No key colums are specified for the update table "AMS!Invoice". Use the KeyFieldList property of the cursor"
When I use the KeyFieldList property on the Invoice table, I get another error message.
I can't use the view designer because I am limited to three tables.
Can I get some help?
The following is the SQL view I create:
CREATE SQL VIEW lvShipping AS;
SELECT SO.PONO,;
INVOICE.CUSTCODE,;
CUSTOMER.NAME AS CUSTOMERNAME,;
INVOICE.SHIPDATE,;
INVOICE.TRANSPORTCODE,;
TRANSPORT.NAME AS TRANSPORTNAME,;
INVOICE.WAYBILLNO,;
INVOICE.ID,;
INVOICE.INVDATE,;
INVOICE.SOID;
FROM AMS!INVOICE;
LEFT OUTER JOIN AMS!SO ON INVOICE.SOID=SO.ID;
LEFT OUTER JOIN CUSTOMER ON SO.CUSTOMERID=CUSTOMER.ID;
LEFT OUTER JOIN CUSTOMER_SHIP_VIA ON INVOICE.TRANSPORTID=CUSTOMER_SHIP_VIA.ID;
LEFT OUTER JOIN TRANSPORT ON TRANSPORT.ID=CUSTOMER_SHIP_VIA.TRANSPORTID;
ORDER BY INVOICE.SHIPDATE DESC
USE AMS!lvShipping IN 0 SHARED
CURSORSETPROP("SendUpdates", .T., "lvShipping")
Thanks in advance!
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only