If we have a concurrent program as of type host(Unix Shell Script), then the program by default either completes Normal or in Error.
If we return from shell script using text exit 0, program completes in normal and if we use any value other value e.g. exit 1, exit 2, exit 10 etc then the program completes in error.
Below is the code that can be used if requirement is to complete it in warning.
sqlplus -s $p_usr_pwd <<-EOF
set feedback off
declare
l_stat Boolean;
l_session_id Number;
begin
fnd_global.initialize(session_id => l_session_id
, user_id => fnd_global.user_id
, resp_id => fnd_global.resp_id
, resp_appl_id => fnd_global.resp_appl_id
, security_group_id => null
, site_id => null
, login_id => null
, conc_login_id => null
, prog_appl_id => null
, conc_program_id => null
, conc_request_id => $p_req_id
, conc_priority_request => null);
l_stat := fnd_concurrent.set_completion_status('WARNING','Completed in Warning. Review log for details.');
commit;
end;
/
exit;
EOF
In the example above $p_usr_pwd stores database username/password, $p_req_id stores the request ID for concurrent request that needs to complete in warning.
Related Post:
Concurrent program parameter in Unix Shell Script
Calling SQLPLUS from unix shell script