Search code examples
phpsqloracleoci8ora-00900

Return a 'DESC package' in PHP using OCI


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


Solution

  • 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...

    Select * from user_arguments where package_name = 'my_package'