php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37220 LOB Type mismatch when using windows & oci8.dll
Submitted: 2006-04-27 11:53 UTC Modified: 2012-10-26 05:26 UTC
Votes:8
Avg. Score:3.6 ± 0.9
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:6 (100.0%)
From: lbouteille dot ext at francetelecom dot com Assigned: sixd (profile)
Status: No Feedback Package: OCI8 related
PHP Version: 5.1.2 OS: Win 2000
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-04-27 11:53 UTC] lbouteille dot ext at francetelecom dot com
Description:
------------
I'm currently facing this problem with : 
- 1 production environnement (Unix,Oracle 9.2, Apache 2.046, Php 5.0.4) 
- 1 developpment env (Windows, Apache 2.046,Php 5.0.4 and using the 
production database) 

then trying to update an XML field of my database (see code)

The only difference I found is : 
- production php is compiled --with-oci8 
- dev php is using php_oci8.dll through php.ini 

I guess this is a problem with windows oci8.dll ?


Reproduce code:
---------------
$query = "UPDATE  table 
SET     table= updateXML(table,'/TABLE/DATA,xmltype.createXML(:data)) 
WHERE   existsNode(projet,'/PROJET/[ID=$id]')=1"; 
$stmt =  oci_parse ($_SESSION['conn'], $query); 


$clob = OCINewDescriptor($_SESSION['conn'], OCI_D_LOB); 
oci_bind_by_name($stmt, ':data', &$clob, -1,OCI_B_CLOB); 
$clob->WriteTemporary($xml,OCI_TEMP_CLOB); 
$success = OCIExecute($stmt,OCI_COMMIT_ON_SUCCESS); 
OCIFreeStatement($stmt); 
$clob->free(); 




Expected result:
----------------
This should be working fine, like on the production (unix) machine

Actual result:
--------------
It will say : ORA-24805 LOB Type mismatch (error at line OCIExecute(...)) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-27 13:43 UTC] lbouteille dot ext at francetelecom dot com
_
 [2006-05-01 07:12 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2006-05-03 13:43 UTC] lbouteille dot ext at francetelecom dot com
I can't start my Apache Server with the latest snapshot..
say something wrong :

can't find OCIStmtPrepare2 in the OCI.dll

did something wrong ?
 [2006-05-03 13:52 UTC] tony2001@php.net
Yes, Oracle Instant Client is required.
 [2006-05-03 13:57 UTC] lbouteille dot ext at francetelecom dot com
It's installed, I can find the OCI.dll in the oracle client BIN folder.. 
the ORACLE_HOME var is set... 

What's next ?
 [2006-05-03 14:11 UTC] tony2001@php.net
Oracle Client and Oracle INSTANT Client are different things. 
OCI8 Win32 builds are done using Instant Client, so you can't use OCI8 dlls with outdated Oracle8 and Oracle9 client libraries anymore.
You need to install Oracle Instant Client 10.x (or native Oracle Client 10.x, but it doesn't make any sense, since installing instant client is much more easier).

 [2006-05-08 14:16 UTC] contact at infochallenge dot com
The oracle documentation says InstantClient is required for connecting php to a remote oracle server, what about Local Oracle?
Installing Instant Client on an already existing oracle server doesn't help, instant client was designed for remote machines
 [2006-05-11 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-08-07 08:41 UTC] lbouteille dot ext at francetelecom dot com
I've installed Oracle instant client (10.2)
Same error on my command : "LOB Type Mismatch"...

This is really an annoying bug !
Does everybody working on PHP with Linux only ??
 [2006-08-07 09:08 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-08-07 09:18 UTC] lbouteille dot ext at francetelecom dot com
I can't put the code online, but as it is really short, i'm writing it here :

<?php
	//do the connection to the Oracle 9.2.0.7 database
	$conn = oci_pconnect($user,$password, $db);
	$xml = "<MYTAG/>";
	//now let's update the row where myId = 1234 and change the mother tag 'THETAG' to 'MYTAG' (MyColumn is a XMLTYPE datatype and myTable a std Oracle table)
	$query = "UPDATE  myTable 
		SET     myTable.myColumn = updateXML(myTable.myColumn,'/THETAG',xmltype.createXML(:data)) 
		WHERE   existsNode(myTable.myColumn,'/THETAG[@myID=\"1234\"]')=1"; 
	$stmt =  oci_parse ($conn, $query); 
	$clob = OCINewDescriptor($conn, OCI_D_LOB); 
	oci_bind_by_name($stmt, ':data', &$clob, -1,OCI_B_CLOB); 
	$clob->WriteTemporary($xml,OCI_TEMP_CLOB); 
	$success = OCIExecute($stmt,OCI_COMMIT_ON_SUCCESS); 
	OCIFreeStatement($stmt); 	
	$clob->free(); 
?>
 [2006-08-07 09:54 UTC] tony2001@php.net
I don't have table myTable with column myColumn and procedures updateXML() and existsNode().
 [2006-08-07 11:30 UTC] lbouteille dot ext at francetelecom dot com
Here is the SQL command to create database :
CREATE TABLE myTable ( myColumn XMLTYPE NOT NULL)

and then tu put a row in the table:
INSERT INTO myTable VALUES(XMLTYPE('<THETAG myID="1234"></THETAG>'))

updateXML() and existsNode() are not procedures, they are part of the Oracle query system (to query XMLTYPE values)
 [2006-08-09 12:24 UTC] tony2001@php.net
I get only this:
Warning: ociexecute(): ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00245: extra data after end of document
 [2006-08-09 12:55 UTC] lbouteille dot ext at francetelecom dot com
Check the detail of the error message : Sounds like XML wasn't valid.. it's working on my Linux server anyway.. maybe some oracle configuration to deal with XML ?

Oracle Error :: LPX-00245 extra data after end of document
Cause
After the close of the top-level element, more data was found.
Action
The end-element tag for the top-level element must be the last thing in the document.
 [2006-08-09 13:17 UTC] tony2001@php.net
Okay, it works with Oracle 10g on Linux.
 [2006-08-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-08-22 13:14 UTC] lbouteille dot ext at francetelecom dot com
Yes it is working with Oracle10G on Linux, but what about fixing it on windows ?
 [2006-09-01 14:08 UTC] lbouteille dot ext at francetelecom dot com
why suspended ?
 [2010-10-27 12:04 UTC] tony2001@php.net
-Assigned To: tony2001 +Assigned To: sixd
 [2012-10-26 05:26 UTC] sixd@php.net
-Status: Suspended +Status: No Feedback
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Feb 05 18:03:43 2023 UTC