Get parameter name

I want to get the parameter name in plsql.

For instance,

procedure sp_example(myParam in varchar2) is

paramName varchar2(30);
begin
    paramName = 'myParam';
end
end procedure sp_example;

Is there a way to get the name myParamusing reflection rather than hard coding it?

+5
source share
2 answers

Try:

select argument_name from all_arguments where object_name = 'SP_EXAMPLE';

This view can also display data types, positions, etc., and you can use it in SQL or PL / SQL. A lot of information in various representations of metadata.

+6
source

If you want to get the names of the parameters obtained in their respective positions, use

select argument_name from user_arguments where object_name='SAMPLE_PROC' order by position;

+1
source

All Articles