Errbuf and Retcode Parameters

Errbuf and Retcode Parameters, www.askhareesh.com
Errbuf and Retcode are used in PL/SQL procedures which are called through concurrent requests. This are two OUT parameters.

1)What is the purpose of Errbuf and Retcode Paramters?
The status of the request is sent to concurrent manager through these Errbuf and Retcode parameters at the end of execution of concurrent request.

Errbuf parameter is used to store error message.

Retcode parameter is used to record the status of the concurrent request.
Retcode has 3 values
0 – Success
1 – Success but finished with Warning (yellow color)
2 – Error (red color)

Note: Errbuf and Retcode must be as first and second parameter in PL/SQL procedure respectively.

2)How to Use Errbuf and Retcode Parameters?
We can debug the issues easily by using these two parameters.
Values can be passed to these parameters in exception blocks.

EXCEPTION
      WHEN OTHERS
      THEN
         retcode := 2;
         errbuf:= 'Unexpected Error from ABC Procedure'||SQLERRM;
END;

*/