Set the Connection Information for the OData Service

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:

  1. Set the appropriate values for the transaction object.

  2. Connect to the OData service.

  3. Set the transaction object for the DataWindow or DataStore.

  4. Retrieve and update the data.

  5. 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.