Question

How can I read the stored procedure interface (signature) in a given package using Oracle.ManagedDataAccess.Client (or Oracle.DataAccess.Client) so that I can infer the required parameters, their types/lengths, and whether they are IN, OUT, or both?

Example: given that I am looking for somePackage.someProc give me back the definition (not the body) for that proc in the most easily consumable format.

Était-ce utile?

La solution

All relevant information about procedure/function parameters is located in the metadata view ALL_ARGUMENTS.

For example:

SQL> CREATE PACKAGE somePackage AS
  2     PROCEDURE someProc (p_arg1 NUMBER, p_arg2 OUT VARCHAR2);
  3  END;
  4  /

Package created

SQL> SELECT package_name, object_name, position, argument_name, data_type, in_out
  2    FROM user_arguments
  3   WHERE package_name='SOMEPACKAGE';

PACKAGE_NAME  OBJECT_NAME   POSITION ARGUMENT_NAME  DATA_TYPE  IN_OUT
------------- ------------ --------- -------------- ---------- ---------
SOMEPACKAGE   SOMEPROC             1 P_ARG1         NUMBER     IN
SOMEPACKAGE   SOMEPROC             2 P_ARG2         VARCHAR2   OUT
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top