0% found this document useful (0 votes)
140 views

First Script: Job - Contact

This document describes using a control table to run a BODS job for either a full or incremental load. It allows the same job to be reused for both scenarios. The control table stores the last update date to determine what new or changed data needs to be loaded. This improves performance by reducing execution time and memory usage compared to querying the base table directly.

Uploaded by

Punith M P
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views

First Script: Job - Contact

This document describes using a control table to run a BODS job for either a full or incremental load. It allows the same job to be reused for both scenarios. The control table stores the last update date to determine what new or changed data needs to be loaded. This improves performance by reducing execution time and memory usage compared to querying the base table directly.

Uploaded by

Punith M P
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

BODS Job using control table.

 Benefits
1) Same job can be used for Full load and Incremental load, thus reducing the number of jobs.
2) The use of control table for determining the last_update date improves the job performance
and reduces execution time.
 Sample Job
JOB_CONTACT

First Script

$LAST_UPDATE_DATE =sql(‘APPS_HANA_DS','SELECT MAX_VALUE from


COMMDIM.BODS_JOBS_CONTROL_TABLE WHERE TABLE_NAME= \'CONTACT\' AND
SCHEMA_NAME= \'SRC_SALES\' ');
$LOAD_FLAG=sql('APPS_HANA_DS','SELECT LOAD_TYPE_FLAG from
COMMDIM.BODS_JOBS_CONTROL_TABLE WHERE TABLE_NAME= \'CONTACT\' AND
SCHEMA_NAME= \'SRC_SALES\' ');
Conditional block

Final script
$Last_update_date_target=sql('SRC_SALES_DS','SELECT MAX(UPDATION_DATE) from CONTACT
WHERE UPDATION_DATE > to_date(\'[$LAST_UPDATE_DATE]\',\'yyyy-mm-dd\') ');

sql('APPS_HANA_DS','UPDATE COMMDIM.BODS_JOBS_CONTROL_TABLE SET MAX_VALUE


=\'[$LAST_UPDATE_DATE_TARGET]\' , LOAD_TYPE_FLAG = \'I\' WHERE TABLE_NAME=
\'CONTACT\' AND SCHEMA_NAME= \'SRC_SALES\' ');
Control table

 During the CR deployment, a new row has to be inserted in the control table
MAX_VALUE = ‘1900-01-01’
LOAD_TYPE_FLAG=’F’

 After the first job run, the MAX_VALUE and LOAD_TYPE_FLAG gets updated as below
MAX_VALUE =last_update_date
and LOAD_TYPE_FLAG = ‘I’

SELECT * from COMMDIM.BODS_JOBS_CONTROL_TABLE WHERE TABLE_NAME= 'CONTACT' AND


SCHEMA_NAME= 'SRC_SALES'

 Memory allocation and Execution time with Control job

a) Scenario 1: using base table


---Example querying the base table to fetch max_updation_date
select max(last_upd) from src_crm.S_OPTY_HIST;
--Execution time is 14ms
--Memory Allocation is 32.5 MB

select count(*) from src_crm.S_OPTY_HIST;--836,280


b) Scenario 2 : using control table
SELECT TO_DATE(MAX_VALUE) from COMMDIM.BODS_JOBS_CONTROL_TABLE WHERE
TABLE_NAME= 'CONTACT' AND SCHEMA_NAME= 'SRC_SALES';--Jul 28, 2016

--Execution time is 5ms


--Memory Allocation is 2.7 MB

SELECT
count(*)
from src_crm.S_OPTY_HIST
WHERE last_upd > to_date('2016-07-28', 'yyyy-mm-dd'); --214

select max(last_upd) from src_crm.S_OPTY_HIST


WHERE last_upd > to_date('2016-07-28', 'yyyy-mm-dd');
--Execution time is 5 ms 890 µs
--Memory Allocation is 3.1 MB
Difference

Base table Approach Control table Approach


Execution time 14ms 5ms + 5 ms 890 µs =10 ms 890 µs
Memory Allocation 32.5 MB 2.7 MB + 3.1 MB = 5.8 MB

You might also like