I was writing pl sql function and face problem in error location detection.Here is a sample function:
FUNCTION my_function(data_input VARCHAR2) return VARCHAR2 AS ret VARCHAR2;
v_code NUMBER;
v_errm VARCHAR2(500);
BEGIN
ret := 101+data_input; --sample error as an example
RETURN 'Success: '||ret;
EXCEPTION
WHEN OTHERS THEN
v_code := SQLCODE;
v_errm := SUBSTR(SQLERRM, 1 , 500);
RETURN 'Error: '||v_code||v_errm;
END my_function;
I used also $$plsql_line, It works at a fix line.but it does not locate error line number at any where of the function.
I want to write code in a way that will locate the line number where error occurred (so it is not fixed line/ its dynamic)
please help me.thanks