You have already seen how a temp-table can inherit either one or all of the indexes from an underlying table, in the CREATE-LIKE() method. You can also add indexes one at a time using other methods. The first of these is the ADD-LIKE-INDEX() method. This method adds a single index to the temp-table that is derived from an existing index on another table. You specify the name you want the index to have in the temp-table, the name of the index in the source table, and either the buffer-handle to the source table or an expression holding its name:
tt-handle:ADD-LIKE-INDEX( tt-index-name-exp , source-index-name-exp
    {, source-buffer-handle-exp | source-db-table-name-exp } ).
This example adds the CustNum index to the temp-table, in addition to the Name index that was added in the CREATE-LIKE() method:
DEFINE VARIABLE hTT AS HANDLE NO-UNDO.
CREATE TEMP-TABLE hTT.
hTT:CREATE-LIKE("Customer","Name").
hTT:ADD-FIELDS-FROM("SalesRep","MonthQuota").
hTT:ADD-LIKE-FIELD("Area", "SalesRep.Region").
hTT:ADD-NEW-FIELD("Sequence", "INTEGER",0,"9999",1000).
hTT:ADD-LIKE-INDEX("CustNum","CustNum","Customer").