Comparing record creation behavior
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Record creation behavior differs between an OpenEdge database and an Oracle database accessed through the DataServer. The following code fragments provide examples of the different behavior.
If
you have a table called customer with a field called custnum defined
as an indexed field, and you write the following procedure:
|
ABL — Does not create the record right
away (at the CREATE statement). It writes it to
the database at the end of the record scope or when the index information
is supplied. In this example, ABL writes the record after the statement:
|
OpenEdge DataServer for Oracle — Writes the record to Oracle later than it is written to an OpenEdge database. The DataServer writes the record at the end of the record scope.
Another example of the differences between ABL and the DataServer occurs if you write a procedure similar to the following:
|
ABL — Displays customer 111.
OpenEdge DataServer
for Oracle — Fails to find customer 111 because
it has not yet written the record that contains customer 111
to the database.
To get the correct response from the DataServer, use the following program:
|
In this example, however, using a VALIDATE statement
causes the DataServer to write the record to the database. The VALIDATE statement
causes the DataServer to write the record that contains customer
111 to the database before the FIND statement occurs.
The RELEASE statement also causes the DataServer
to write the record to the database; however the RELEASE statement
clears the contents of buffers.
ROWID function
might cause a newly created record to be written earlier to an Oracle
database than to an OpenEdge database. If you do not assign values
to all mandatory fields for a record, the ROWID function
will fail.This difference in behavior might also be apparent when you open a query. Newly created records might not appear in the results set of queries that you opened before you created the records. Reopen the query to access the new records.