Copying Media Object record from one database to another database

Veeraragavan

Veeraragavan

Member
I am working on enhancement of an archiving and purging business function. The business function was already developed to archive records from 35 tables from source database to archiving database.

Request now is to include Media Object in scope.

In Existing Function all the 35 tables are being archived by following procedure.

Select Key in Source
Fetch Next record in source
Insert into destination database above fetched record.

I tried similar procedure for Media Object file, but unfortunately the Fetch on Media Object fails for some reasons.

After some investigations, I figured out that Fetch on Media object always fail, and there are some APIs like below should be used.
JDEGTAdd
JDEGTAddRecord
FreeStrFromDstmpl
GetAllGenericTextName
JDEGTAIIocFetch
JDEGTAIIocFetchText
JDEGTDeIete
JDEGTExists
JDEGTFree
JDEGTMOExists
JDEGTTextFree
JD EG T U p d ate
ModifyGenericTextName
StripKey

But all these APIs are designed in such a way to add records in same environment.

Have anyone tried this kind of activities on Media Object File.

Would be great if someone can throw some light on this. Thanks in Advance.

Regards,
Veera
 
Veera,

To select data from the target envionment, you can use the following APIs:
* jdeGT_OpenTable
* jdeGT_SelectData
* jdeGT_FetchData

To insert data into the target envionment, you can use:
* jdeGT_OpenTable
* jdeGT_InsertData

To delete data in the source environment, you can use:
* jdeGT_OpenTable
* jdeGT_DeleteData

You will probably have to use these API in loop over the source F00165 to select the F00165 record, insert it and then delete it.

Note that this will only copy the F00165 records - You will also need to write code to move the physical media object files for file attachments (assuming you want the files to be archived as well).

Hope this helps.
 
Back
Top