OCCI:查询包内存储过程的元数据
我正在尝试获取有关使用 C++ Oracle OCCI 在包中定义的存储过程参数的元数据。获取独立过程的参数元数据很简单:
MetaData meta = connection->getMetaData("MY_PROC");
vector<MetaData> params = meta.getVector(MetaData::ATTR_LIST_ARGUMENTS);
但是,如果我尝试使用以下代码从包内的过程查询参数元数据,则会收到错误。
MetaData meta = connection->getMetaData("PKG_MY_PACKAGE.MY_PROC2");
错误消息:
ORA-04043: object PKG_MY_PACKAGE.MY_PROC2 does not exist
知道为什么这不起作用,或者我是否需要查询包中以不同方式定义的存储过程参数?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查询
all_arguments
(或user_arguments
或dba_arguments
)视图来检索打包函数和过程的参数。http://download.oracle.com/文档/cd/B19306_01/server.102/b14237/statviews_1014.htm#i1573843
You can query the
all_arguments
(oruser_arguments
ordba_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