ID: 35280 Updated by: [EMAIL PROTECTED] Reported By: tawood at vlsmaps dot com -Status: Assigned +Status: Feedback Bug Type: OCI8 related Operating System: Fedora 4 PHP Version: 5.0.5 Assigned To: tony2001 New Comment:
Please add expected and actual results. That's what I get with the code you've provided: BT_IDX : 0<br /> REG_FLOAT : 0<br /> BIN_FLOAT : 0<br /> BT_IDX : 1<br /> REG_FLOAT : 2.331<br /> BIN_FLOAT : 2.33100224E+000<br /> BT_IDX : 2<br /> REG_FLOAT : 4.662<br /> BIN_FLOAT : 4.66200447E+000<br /> BT_IDX : 3<br /> REG_FLOAT : 6.993<br /> BIN_FLOAT : 6.99300718E+000<br /> BT_IDX : 4<br /> REG_FLOAT : 9.324<br /> BIN_FLOAT : 9.32400894E+000<br /> BT_IDX : 5<br /> REG_FLOAT : 11.655<br /> BIN_FLOAT : 1.16550121E+001<br /> BT_IDX : 6<br /> REG_FLOAT : 13.986<br /> BIN_FLOAT : 1.39860144E+001<br /> BT_IDX : 7<br /> REG_FLOAT : 16.317<br /> BIN_FLOAT : 1.63170166E+001<br /> BT_IDX : 8<br /> REG_FLOAT : 18.648<br /> BIN_FLOAT : 1.86480179E+001<br /> BT_IDX : 9<br /> REG_FLOAT : 20.979<br /> BIN_FLOAT : 2.09790211E+001<br /> I don't see any problems here. 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