0
接受客戶編號,然後將每個訂單和項目的詳細信息輸出到編輯器小部件。 在編輯器小部件(編輯器1作爲對象名稱)中顯示它們。在數據庫中搜索後,如何使用進度在編輯器小部件中顯示結果字段值4gl
define temp-table ttcustomer
field custnum like customer.cust-num
field cname like customer.name
field orders like order.order-num
field items like item.item-num
field itemname like item.item-name .
find first customer WHERE customer.cust-num = input f1 NO-LOCK .
create ttcustomer .
assign
ttcustomer.custnum = customer.cust-num
ttcustomer.cname = customer.name.
for each order WHERE Order.cust-num = input f1 NO-LOCK .
assign
ttcustomer.orders = order.order-num.
for each order-line where order-line.order-num = order.order-num no-lock.
for each item where item.item-num = order-line.item-num no-lock.
assign
ttcustomer.items = item.item-num
ttcustomer.itemname = item.item-name.
end.
end.
end.
我嘗試使用您告訴的代碼,但由於無法更新ttcustomer表而導致錯誤,因爲我只是想分配。 – sri
我正在重新閱讀你的代碼。您需要了解Progress語法和命令的工作原理,才能做到這一點。 首先,您創建的頂級tt客戶創建一條記錄。您在每個訂單循環中的所有後續分配都將覆蓋您以前的任何值。同樣的項目,無論你在循環中騎自行車的人數多少,你最終都會得到一個記錄。 研究一下關於臨時表,然後連接信息。如果可能的話,遵循一些教程或正式培訓,它會幫助你很多。 – bupereira
謝謝@bupereira :) – sri