Fetch on Table from different datasource

jfarragher

Member
Hi,
I am trying to do a Fetch on F0901 from an Xe data source to retrieve data into E910. I have written a C business function using JDB_SetSelection,JDB_SelectKeyed & JDB_Fetch after opening the table with the data source specified. It works when I pass in a data source for PS910. The fetch always fails for my Xe data source. I presume it is because the table has changed between Xe and E910. UTB fails to show any records for the table using this datasource. It does show records for F0008 which hasn't changed. Is there a way around this?
 
When you open the table you might try specifying a list of columns instead of all columns. That might work.

Probably the correct thing to do is to treat it (the Xe table) as a foreign table and use the foreign table API calls to read from it.

Or, even easier. Create a virtual table in 9.x that has the Xe structure. Then simply read from the custom table (the virtual table) using the standard JDEBase API calls. In fact if you don't want to explicitly set the alternate data source in code you could even use OCMs to map the virtual table to the Xe data source.
 
Thanks for that. Tried selected columns and business views to no avail. The virtual table sounds like the way to go.
 
Back
Top