As with other databases, use the SQLCA Transaction object (or user-defined transaction object) to retrieve and display data from the OData service in a DataWindow or DataStore.
To retrieve and display data from the OData service in a DataWindow or DataStore:
-
Set the appropriate values for the transaction object.
-
Connect to the OData service.
-
Set the transaction object for the DataWindow or DataStore.
-
Retrieve and update the data.
-
When the processes are complete, disconnect from the OData service.
The code looks something like this:
SQLCA.DBMS = "ODT" SQLCA.DBParm = "ConnectString='URI=http://esx2-appserver/TestDataService/Employee.svc'" //connect to the service connect using SQLCA; dw_1.SetTransObject(SQLCA) dw_1.Retrieve() ... //disconnect from the service disconnect using SQLCA;
For more information on using the global Transaction object, see Using Transaction Objects in Application Techniques.