OCCI: Querying for metadata of a stored procedure within a package
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?
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_01/server.102/b14237/statviews_1014.htm#i1573843
精彩评论