Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Introduction to External Program Interfaces : Using MEMPTR to reference external data : Reading and writing data : Copying between database records and MEMPTR
 
Copying between database records and MEMPTR
Copying a database record to and from a MEMPTR variable relies on the RAW-TRANSFER statement. This statement allows you to copy a whole database record buffer to a RAW variable or to copy a RAW variable to a database record buffer.
To store a database record in a MEMPTR variable:
1. Copy the record buffer to a RAW variable using the RAW-TRANSFER statement.
2. Assign the RAW variable to the MEMPTR variable or to the specified position in the MEMPTR variable using the PUT-BYTES statement.
To retrieve a database record from a MEMPTR variable:
1. Assign the MEMPTR variable to a RAW variable or use the GET-BYTES function to copy the specified bytes from the MEMPTR to the RAW variable.
2. Copy the RAW variable to the record buffer using the RAW-TRANSFER statement.