|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-19 15:01 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 16:00:01 2025 UTC |
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.