The ROWID value of a temp-table buffer will be different than the ROWID value of a record BUFFER even if the underlying data is identical. This difference exists because the ROWID function relies on the record buffer name.
Expected ABL behavior—ROWID value of a temp-table buffer
The following example shows the standard, expected ABL behavior.
DEFINE VARIABLE rid-1 AS ROWID NO-UNDO.
DEFINE VARIABLE rid-2 AS ROWID NO-UNDO.
DEFINE VARIABLE ttHandle AS HANDLE NO-UNDO EXTENT 1.
DEFINE TEMP-TABLE ttCustomer LIKE Sports2000.Customer
FIELD tRecid AS INTEGER
FIELD tRECID_ident AS INTEGER.
ttHandle[1] = TEMP-TABLE ttCustomer:HANDLE.
FIND FIRST Customer WHERE Customer.CustNum = 1 NO-LOCK.
rid-1 = ROWID(Customer).
RUN STORED-PROC send-sql-statement
LOAD-RESULT-INTO ttHandle ("select * from customer where custnum = 1").
rid-2 = ROWID(ttCustomer).
IF rid-1 NE rid-2 THEN
MESSAGE "The same record but different ROWID's".
The following sections illustrate the differences between the ROWID value of a temp-table buffer and the ROWID value of a record BUFFER so that you can best understand, program for, and leverage the use of the ROWID function with the LOAD-RESULT-INTO clause of the RUN STORED-PROCEDURE command.