php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47557 New Collection not working on Packages
Submitted: 2009-03-04 10:34 UTC Modified: 2009-03-13 23:43 UTC
From: biton at compuserve dot com Assigned: sixd (profile)
Status: Not a bug Package: OCI8 related
PHP Version: 5.2.9 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: biton at compuserve dot com
New email:
PHP Version: OS:

 

 [2009-03-04 10:34 UTC] biton at compuserve dot com
Description:
------------
oci_new_collection() works fine on a 'TYPE' created by a user. However, if the 'TYPE' is created as part of a package, oci_new_collection() appears not to find it.



<?php

$c = oci_pconnect(...);
// Works.
sql = 'create or replace type email_array as varray(200) of varchar2(20);
$s = oci_parse($c, $sql);
oci_execute($s, $sql);
$collec = oci_new_collection($c, 'EMAIL_ARRAY');

// Fails
sql = 'create or replace type package.email_array as varray(200) of varchar2(20);
$s = oci_parse($c, $sql);
oci_execute($s, $sql);
$collec = oci_new_collection($c, 'PACKAGE.EMAIL_ARRAY');

?>

If the TYPE is created as part of the package (and not through PHP), this also fails. Any combination of user/package/type_name appears not to work. 

The workaround is to create a TYPE in teh user global area of the same type as that in the package, and use that in a wrapper PL/SQL block. While this works... it kindda defeats the point behind packages. 



Reproduce code:
---------------
---
From manual page: function.oci-new-collection
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-13 23:43 UTC] sixd@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is a expected with the current OCI8 implementation.  Code patches to improve PL/SQL object & type support are welcome.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 16:01:29 2024 UTC