Try OpenEdge Now
skip to main content
DataServer for Oracle
RDBMS Stored Procedure Details : ROWID support : Additional ProDataSet support
 

Additional ProDataSet support

As demonstrated in the above example, the LOAD-RESULT-INTO functionality provides a very fast and efficient way to populate the temp-table(s) of a ProDataSet Object.
Using the LOAD-RESULT-INTO technique with BEFORE-FILL method to fill the temp-table(s) of a ProDataSet
This example builds on the techniques demonstrated in , but the previous example shows the ProDataSet object BEFORE-FILL procedure can be modified to provide a single ProDataSet data access object that can be used against native OpenEdge or against Oracle and other DataServer data sources.
DEFINE VARIABLE hSendSQL  AS HANDLE NO-UNDO EXTENT 1.
DEFINE VARIABLE phDataSet AS HANDLE NO-UNDO.
DEFINE VARIABLE rid-1     AS ROWID  NO-UNDO.
DEFINE VARIABLE rid-2     AS ROWID  NO-UNDO.

DEFINE TEMP-TABLE ttCustomer LIKE Sports.Customer
  FIELD rRecid AS ROWID.

hSendSQL[1] = TEMP-TABLE ttCust:HANDLE.

DEFINE DATASET dsCustomer FOR ttCustomer.
DEFINE QUERY qCustomer FOR Customer.

phDataSet = DATASET dsCust:HANDLE.
phDataSet:SET-CALLBACK-PROCEDURE
  ("BEFORE-FILL", "preDataSetFill", THIS-PROCEDURE).

DEFINE DATA-SOURCE srcCustomer FOR QUERY qCustomer.
BUFFER ttCustomer:HANDLE:ATTACH-DATA-SOURCE
  (DATA-SOURCE srcCustomer:HANDLE,?,?,?).
DATASET dsCustomer:FILL().

FIND FIRST customer WHERE customer.custnum = 1 NO-LOCK.
rid-1 = ROWID(customer).

FIND FIRST ttCustomer WHERE ttCustomer.custnum = 1 NO-LOCK.
rid-2 = ttCustomer.rRecid.

IF rid-1 <> rid-2 THEN
  MESSAGE "The same record but different ROWID's".
IF rid-1=rid-2 THEN
  MESSAGE "Congratulations - we have the same ROWID's".

MESSAGE STRING(ttCustomer.rRecid) VIEW-AS ALERT-BOX.