TOracleDataSet or TOracleQuery

nboodram

Member²
Hello,

I'm starting to convert a large multi-tier application from the BDE to DOA. When would I want to use TOracleDataset vs. TOracleQuery? Right now our application server program uses the BDE's TQuery components. I read that TOracleQuery does not descend from TDataSet, so I'm not sure when it would be preferable to use one over the other. For 95% of the time, I would need the component to give data to a TDatasetProvider for use by a TClientDataSet.
We do also have a couple of stored procedures that we use the BDE's TStoredProc component for.

Thanks,
Natalie
 
You should always use a TOracleQuery, unless you need the TDataSet interface. The TOracleQuery does not have any TDataSet overhead, and is more flexible.

For a TDataSetProvider, or for other data-aware controls that need a TDataSource, you need to use the TOracleDataSet.

------------------
Marco Kalter
Allround Automations
 
It's the other way around: the TDataSource component has a DataSet property.

------------------
Marco Kalter
Allround Automations
 
Actually, TDataSet components do have a DataSource property (e.g. TQuery, which is what we are using now). This is used for creating nested relationships with parameterized queries. Nested relationships are a crucial part of our application. How is this accomplished with DOA?

Natalie
 
I was under the impression that MasterSource and MasterFields set up master detail AFTER your data was retrieved. Using the DataSource property makes sure that you retrieve the detail for only those records in your master. If your master SQL is complex, the detail SQL does not need to repeat that complexity to get the same subset of records. Comments, anyone?
 
One other comment that I forgot in my earlier post-- when using MasterSource and MasterFields, does the client side access the data through the DataSetField property of the clientdataset? This is used throughout our code and would be a pain to have to change it.
 
You can indeed use the DataSetField property of the TClientDataSet, in combination with the Master/MasterFields/DetailFields property of the connected (detail) TOracleDataSet. The 3Tier demo that is included with Direct Oracle Access works like this.

------------------
Marco Kalter
Allround Automations
 
Back
Top