Question

Calling an API in DataMig to schedule background job


Userlevel 4
Badge +9

I am trying to write a two part DataMig (MS_FORECAST_FILE to load the data then MS_FORECAST_MIG to schedule the import for each part) to load data using:

level_1_forecast_util_api.Schedule_Import_Forecast

 

 

The first job to load the data works fine and I get an IC table ready for the 2nd DataMig job.

To test the SQL code for the ATTR values to pass to the API call, I have a working PL/SQL cursor...

begin

  for ic in (select * FROM IC_MS_FORECAST_FILE IC) loop
    level_1_forecast_util_api.Schedule_Import_Forecast__('CONTRACT' ||
                                                         CHR(31) ||
                                                         IC.CONTRACT ||
                                                         CHR(30) ||
                                                         'PART_NO' ||
                                                         CHR(31) ||
                                                         IC.PART_NO ||
                                                         CHR(30) ||
                                                         'TARGET_MS_SET' ||
                                                         CHR(31) || '1' ||
                                                         CHR(30) ||
                                                         'START_DATE' ||
                                                         CHR(31) ||
                                                         TO_CHAR(IC.START_DATE,
                                                                 'YYYY-MM-DD-HH24.MI.SS') ||
                                                         CHR(30) ||
                                                         'END_DATE' ||
                                                         CHR(31) ||
                                                         TO_CHAR(IC.END_DATE,
                                                                 'YYYY-MM-DD-HH24.MI.SS') ||
                                                         CHR(30) ||
                                                         'DISTRIBUTION' ||
                                                         CHR(31) ||
                                                         IC.DISTRIBUTION ||
                                                         CHR(30) ||
                                                         'PTF_COPY' ||
                                                         CHR(31) ||
                                                         IC.PTF_COPY ||
                                                         CHR(30) ||
                                                         'BUDGET_FORECAST' ||
                                                         CHR(31) || 'F' ||
                                                         CHR(30) ||
                                                         'SCENARIO_ID' ||
                                                         CHR(31) || '0' ||
                                                         CHR(30));
  end loop;
end;

This needs a COMMIT to complete and submit the jobs but when the jobs execute they work as expected.

If I then try and use the same code for the ATTR parameter in the DataMig Job...

 

it submits the background jobs but doesn’t appear to apply any of the parameters from the column SQL.

Has anyone used this kind of DataMig routine and/or seen this kind of problem before ?

 


0 replies

Be the first to reply!

Reply