Here is the situation.
For a simple query I would like to create a temp-table that is like the original and then just add an index to it. The reason for this is that it is not necessary to add the index to the actual table.
Here is my code example:
When I try to run the above I get the error 'Unknown or Ambiguous Table'. Any help would be appreciated.
Thanks,
For a simple query I would like to create a temp-table that is like the original and then just add an index to it. The reason for this is that it is not necessary to add the index to the actual table.
Here is my code example:
Code:
DEF TEMP-TABLE tt-cust LIKE cust
INDEX tt-idx fname[1] lname[1] prim-nm[1] addr[1] addr[2] addr[3] addr[4] city state.
FOR EACH cust NO-LOCK:
CREATE tt-cust.
BUFFER-COPY cust TO tt-cust.
END.
FOR EACH cust NO-LOCK:
FIND FIRST tt-cust NO-LOCK
WHERE tt-cust.fname[1] = cust.fname[1]
AND tt-cust.lname[1] = cust.lname[1]
AND tt-cust.prim-nm[1] = cust.prim-nm[1]
AND tt-cust.addr[1] = cust.addr[1]
AND tt-cust.addr[2] = cust.addr[2]
AND tt-cust.addr[3] = cust.addr[3]
AND tt-cust.addr[4] = cust.addr[4]
AND tt-cust.city = cust.city
AND tt-cust.state = cust.state
AND tt-cust.key <> cust.key
NO-ERROR.
END.
When I try to run the above I get the error 'Unknown or Ambiguous Table'. Any help would be appreciated.
Thanks,