返回“DESC 包”;在 PHP 中使用 OCI
您好,我正在尝试使用 OCI8 直接从 PHP 获取有关 Oracle 包的信息:
$sql = 'DESC my_package'; $stmt = oci_parse($conn, $sql); oci_execute($stmt);
这会返回:
Warning: oci_execute() [function.oci-execute]: ORA-00900: invalid SQL statement in /oci8_test.php on line 16
我知道该命令可以正常工作,就像我在 SQLPlus 中尝试的那样。
有谁知道如何实现这一目标。
谢谢
Hi I am trying to get information on an Oracle package directly from PHP using OCI8:
$sql = 'DESC my_package'; $stmt = oci_parse($conn, $sql); oci_execute($stmt);
this returns:
Warning: oci_execute() [function.oci-execute]: ORA-00900: invalid SQL statement in /oci8_test.php on line 16
I know the command works as I tried it in SQLPlus.
Does anyone know how to achieve this.
Thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
DESC 是 SQL Plus 命令。
我已经离开 Oracle 几年了,但还是查看了一下数据字典。例如,对于表格,您可以执行以下操作。也必须有一些用于包的东西。
DESC MY_TABLE
相当于
DESC is a SQL Plus command.
I have been away from Oracle for a few years now, but look into the data dictionary. For example for tables you could do below. There must be something for Packages as well.
DESC MY_TABLE
is equivalent to
谢谢您的回复,我想我已经找到了答案。
因此,对于任何感兴趣的人,正如文森特所说,我认为要使其发挥作用,您必须创建自己的“DESC”。
要使用的 Oracle 视图是“user_arguments”,您可以获取函数/过程名称、参数名称和类型、参数位置等...
Thx for the replies, I think I have found my answer.
So for anyone who is interested, as Vincent said, I think to make it work you'll have to create your own 'DESC'.
The Oracle View to use is 'user_arguments', you get the function/procedure names, argument names and types, argument position, etc...
DESC
是一个SQL*Plus
命令,它无法在SQL*Plus
中运行。您可以通过从任何工具查询数据字典来编写自己的DESC
:DESC
is aSQL*Plus
command, it won't work out ofSQL*Plus
. You can write your ownDESC
by querying the data dictionnary from any tool: