Try OpenEdge Now
skip to main content
DataServer for Oracle
RDBMS Stored Procedure Details : ROWID support : ROWID characteristics : ROWID: Standard ABL behavior
 
ROWID: Standard ABL behavior
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
This 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 ttCust LIKE Sports.Customer
  FIELD tRecid       AS INTEGER
  FIELD tRECID_ident AS INTEGER.

ttHandle[1] = TEMP-TABLE ttCust: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(ttCust).

IF rid-1 <> 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.