0

我有用于表客户的缓冲区 bufCustomer 用于表订单的全局缓冲区 gbufOrder。但是这段代码不起作用我写了类似 find bufCustomer where bufCustomer.CustomerID = gbufOrder.CustomerID no-lock no-error 的代码。但是如果我检查表格数据,数据就在那里,但是如果我写了上面这样的代码,它就不起作用了。有没有其他方法可以获取值?

4

1 回答 1

1

带缓冲区:

DEFINE BUFFER gbufOrder FOR Order.
DEFINE BUFFER bufCustomer FOR Customer.

FIND FIRST gbufOrder NO-LOCK NO-ERROR.
IF AVAILABLE(gbufOrder) THEN
   DO:
      FIND bufCustomer where bufCustomer.CustNum = gbufOrder.CustNum NO-LOCK NO-ERROR.

      IF AVAILABLE(bufCustomer) THEN
         DO:
            DISP bufCustomer.name.
         END.
      ELSE
         DO:
            MESSAGE "Customer is not available!"
               VIEW-AS ALERT-BOX ERROR BUTTONS OK.
         END.
   END.
ELSE
   DO:
      MESSAGE "Order is not available!"
          VIEW-AS ALERT-BOX ERROR BUTTONS OK.
   END. 

无缓冲

FIND FIRST Order NO-LOCK NO-ERROR.
IF AVAILABLE(Order) THEN
   DO:
      FIND Customer where Customer.CustNum = Order.CustNum NO-LOCK NO-ERROR.

      IF AVAILABLE(Customer) THEN
         DO:
            DISP Customer.name.
         END.
      ELSE
         DO:
            MESSAGE "Customer is not available!"
               VIEW-AS ALERT-BOX ERROR BUTTONS OK.
         END.
   END.
ELSE
   DO:
      MESSAGE "Order is not available!"
          VIEW-AS ALERT-BOX ERROR BUTTONS OK.
   END.

该程序适用于sports200示例数据库(位于 PROGRESS / OpenEdge 安装目录中)

更新:

  • 检查客户的可用性
  • 添加不带 BUFFER 的示例代码
于 2012-10-09T13:37:31.823 回答