M
Mahesh
Guest
I need to find the customer records whose orderstatus is 'ordered'. How do I accomplish this using dynamic-query? Following code snippet raises an error:
DEFINE VARIABLE qry AS HANDLE.
CREATE QUERY qry.
qry:SET-BUFFERS(BUFFER customer:HANDLE, BUFFER order:HANDLE).
qry:QUERY-PREPARE("for each customer where customer.country eq 'USA' and
can-find(order where order.custnum = customer.custnum
and order.orderstatus eq 'ordered')").
qry:QUERY-OPEN().
REPEAT :
qry:GET-NEXT().
IF qry:QUERY-OFF-END THEN LEAVE.
DISP customer.custnum customer.name customer.salesrep.
END.
qry:QUERY-CLOSE().
DELETE OBJECT qry.
OR is there any workaround for this?
Continue reading...
DEFINE VARIABLE qry AS HANDLE.
CREATE QUERY qry.
qry:SET-BUFFERS(BUFFER customer:HANDLE, BUFFER order:HANDLE).
qry:QUERY-PREPARE("for each customer where customer.country eq 'USA' and
can-find(order where order.custnum = customer.custnum
and order.orderstatus eq 'ordered')").
qry:QUERY-OPEN().
REPEAT :
qry:GET-NEXT().
IF qry:QUERY-OFF-END THEN LEAVE.
DISP customer.custnum customer.name customer.salesrep.
END.
qry:QUERY-CLOSE().
DELETE OBJECT qry.
OR is there any workaround for this?
Continue reading...