ID: 39887 Updated by: [EMAIL PROTECTED] Reported By: tony at marston-home dot demon dot co dot uk -Status: Open +Status: Wont fix Bug Type: OCI8 related Operating System: Windows XP PHP Version: 4.4.4 New Comment:
Use new OCI8 (available in PHP5 and PECL), which contains oci_bind_array_by_name() function. This function should be used in order to get VARRAYs. Previous Comments: ------------------------------------------------------------------------ [2006-12-19 14:53:56] tony at marston-home dot demon dot co dot uk Description: ------------ Oracle version 10g Express Edition. I have a table which contains a VARRAY, a user-defned type. When I attempt to read this table I get the error "ORA-00932: inconsistent datatypes, expected CHAR got ARRAY". Reproduce code: --------------- Here is my table defintion, with the VARRAY datatype: [code] CREATE OR REPLACE TYPE t_fav_food IS VARRAY(10) OF NUMBER(2); CREATE TABLE person ( person_id varchar2(8) NOT NULL, first_name varchar2(20) NOT NULL, last_name varchar2(30) NOT NULL, favourite_food t_fav_food, PRIMARY KEY (person_id) ); [/code] Here s the code that I use to access it: [code] $array = array(); $query = 'SELECT person_id, first_name, last_name, favourite_food FROM person'; $statement = ociParse($conn, $query); $result = ociExecute($statement); while (ociFetchInto ($statement, $row, OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS)) { $array[] = array_change_key_case($row, CASE_LOWER); } // while [/code] I get the error "ORA-00932: inconsistent datatypes, expected CHAR got ARRAY" when performing ociFetchInto() Expected result: ---------------- I expect ociFetchInto() to load the VARRAY column as a collection object which I can then access using the OCI-Collection-> methods, just as I can with large objects and the OCI-Lob-> methods. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39887&edit=1