Obtener el nombre de un parámetro

I want to get a parameter's name in plsql.

Por ejemplo, los servicios administrativos de

procedure sp_example(myParam in varchar2) is

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

Is there a way to get the name of myParam using reflection, instead of hard coding it?

preguntado el 28 de agosto de 12 a las 14:08

2 Respuestas


select argument_name from all_arguments where object_name = 'SP_EXAMPLE';

This view can also show you the data types, positions, etc., and you can use it in SQL or PL/SQL. Plenty of info in the various metadata views.

Respondido 29 ago 12, 00:08

Puedes usar OWA_UTIL.who_called_me y who_am_i procedure to dynamically get the procedure owner and name. But unfortunately there's no easy way to get the name of the procedure within a package. tkyte.blogspot.com/2009/10/… - jon heller

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

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

Respondido 29 ago 12, 19:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.