ID: 35280
Updated by: [EMAIL PROTECTED]
Reported By: tawood at vlsmaps dot com
-Status: Open
+Status: Assigned
Bug Type: OCI8 related
Operating System: Fedora 4
PHP Version: 5.0.5
-Assigned To:
+Assigned To: tony2001
Previous Comments:
------------------------------------------------------------------------
[2005-11-18 18:13:51] tawood at vlsmaps dot com
Description:
------------
I have php 5.0.5, apache 2.0.55 and oci8-beta 1.1.1.
BINARY_FLOAT data types in 10g are always returned as a null value in
php. I have made sure that the values are there via SQL*Plus and the
Enterprise Manager.
In the below example, the output of the binary_float column is empty.
The obvious work around to this is to use a NUMBER data type.
Reproduce code:
---------------
------------
$oraDb = oci_connect("YOUR_SCHEMA","password","TNSNAME");
$oraCreate = 'CREATE TABLE binf_test (bt_idx INTEGER, reg_float NUMBER
(10, 3), bin_float BINARY_FLOAT, CONSTRAINT bt_pk PRIMARY KEY
(bt_idx))';
oci_execute(oci_parse($oraDb, $oraCreate));
for($i=0;$i<10;$i++) {
$decnum = ($i / (.429));
$oraInsert = "INSERT INTO binf_test VALUES (".$i.",
".$decnum.", ".$decnum.")";
oci_execute(oci_parse($oraDb, $oraInsert));
}
$oraSelect = "SELECT * FROM binf_test";
$oraParse = oci_parse($oraDb, $oraSelect);
if (oci_execute($oraParse)) {
while ($oraRow = oci_fetch_assoc($oraParse)) {
foreach ($oraRow as $key => $val) {
echo $key." : ".$val."<br />\n";
}
}
}
oci_close($oraDb);
Expected result:
----------------
The correct values of binary_float columns to be displayed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35280&edit=1