Oracle plsql: retrieve runtime parameter values โ€‹โ€‹when calling a procedure

I need a generic method to get a list of runtime parameters (values) when calling a procedure. I need something similar to $$ PLSQL_UNIT, which returns the name of the current procedure. (plsql Oracle 10g)

eg. look at an example of this procedure: (it just prints its own name and parameters)

CREATE OR REPLACE PROCEDURE  MY_PROC(ow in varchar2, tn IN varchar2)
 IS

BEGIN
     dbms_output.put_line('proc_name: '||$$PLSQL_UNIT||' parameters: '|| ow||' '||tn  );

    EXCEPTION
    WHEN OTHERS THEN 
       DBMS_OUTPUT.PUT_LINE('ERRORE: ' ||SQLERRM);

END MY_PROC;
/

The execution of the procedure produces the following output:

SQL> 
  1   BEGIN
  2     IBAD_OWN.MY_PROC('first_par', 'second_par');
  3   END;
  4  /

proc_name: MY_PROC parameters: first_par second_par

PL/SQL procedure successfully completed.

I am not satisfied because I cannot copy and paste all of my procedures, because I need to hard-code each procedure to set their correct parameter variables.

Thanks in advance for your help.

+5
source share
2 answers

, Oracle PL/SQL. .

, , , $$PLSQL_UNIT . , .

+2

, , .

: DB, //. "" "user_arguments".

, , procs .

, procs .

, .

PS. .

+1

All Articles