on 2024 Mar 06 2:35 AM
In my BODS job, I need to read the last successful run of that job, to get the last succesful run timestamp information. How can we achieve this in BODS job?
Request clarification before answering.
The history of job runs are stored in the repository table AL_HISTORY.
To select the timestamp (start time) of the last successful run of a job you can use the following select statement:
SELECT MAX(START_TIME) FROM [$GV_RUNTIME_REPO_NAME].AL_HISTORY WHERE STATUS = 'D' AND SERVICE = '[job_name()]'
(status 'D' stands for "success")
If you're using the select statement in a script by using the sql function (e.g. to store the selected timestamp in a variable), you have to escape the quotes in the following way:
SELECT MAX(START_TIME) FROM [$GV_RUNTIME_REPO_NAME].AL_HISTORY WHERE STATUS = \'D\' AND SERVICE = \'[job_name()]\'
Best regards
Marcus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
58 | |
10 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.