views:

218

answers:

1

I am trying to get metadata about parameters of a stored procedure that is defined in a package using C++ Oracle OCCI. Getting parameter metadata of a standalone proc is straightforward:

MetaData meta = connection->getMetaData("MY_PROC");
vector<MetaData> params = meta.getVector(MetaData::ATTR_LIST_ARGUMENTS);

However, if I try to query the parameter metadata from a procedure that is within a package with the below code, I get an error.

MetaData meta = connection->getMetaData("PKG_MY_PACKAGE.MY_PROC2");

The error message:

ORA-04043: object PKG_MY_PACKAGE.MY_PROC2 does not exist

Any idea why this is not working or do I need to query for stored procedure parameters that are defined within a package differently?

A: 

You can query the all_arguments (or user_arguments or dba_arguments) view to retrieve parameters for packaged functions and procedures.

http://download.oracle.com/docs/cd/B19306%5F01/server.102/b14237/statviews%5F1014.htm#i1573843

David Aldridge