php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39887 ORA-00932: inconsistent datatypes, expected CHAR got ARRAY
Submitted: 2006-12-19 14:53 UTC Modified: 2006-12-19 15:01 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: tony at marston-home dot demon dot co dot uk Assigned:
Status: Wont fix Package: OCI8 related
PHP Version: 4.4.4 OS: Windows XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tony at marston-home dot demon dot co dot uk
New email:
PHP Version: OS:

 

 [2006-12-19 14:53 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-19 15:01 UTC] tony2001@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 22:01:28 2024 UTC