#45039 [Fbk-Opn]: OCI get number column length returns zero (0)
ID: 45039 User updated by: smelban at norwood dot com Reported By: smelban at norwood dot com -Status: Feedback +Status: Open Bug Type: Oracle related Operating System: Windows 2003 Enterprise Server PHP Version: 5.2.6 New Comment: I've connected my code to both an 10g and 11g database the they both are returning the same incorrect data. Is there a way for me to debug what is actually being returned? I've looked in the all_tab_columns table in both a 10g and 11g databases and the information is correct. I'm also looking at a VARCHAR2 field that returns 0 as the field size. In the table it shows it as a 18 char string but both ocicolumnscale(..) and ocicolumnprecision(..) return 0 and 0; I've found a workaround for myself by querying the the all_tab_columns table but that is just a work around. I 100% certain this worked months back but only assumed it was the 11g issue. I'm not quite sure how to proceed on finding out what is wrong. Oracle Client 10.2.0 Oracle Server Windows 2003 Enterprise Server 32 Bit OCI8 Info Revision is: $Revision: 1.269.2.16.2.30 $ Version: 1.2.3 Previous Comments: [2008-05-20 15:58:23] [EMAIL PROTECTED] What's the version of the Oracle client libraries used by PHP? What platform is the DB on? Are client/server 32bit or 64bit? What does phpinfo() show for the OCI8 Revision? (The problem could be related to http://bugs.php.net/bug.php?id=41917) [2008-05-19 19:00:25] smelban at norwood dot com Description: We just recently upgraded from Oracle 10g to Oracle 11g. Since that move the ocicolumnscale and ocicolumnprecision functions have stopped returning the column length. Windows 2003 Enterprise Server Zend Core 2.5.0 PHP 5.2.5 Reproduce code: --- // mynumber field is a 10,4 decimal $sql = SELECT mynumber FROM TABLENAME; $R = OCIParse($c, $sql); OCIExecute($R); while (OCIFetch($R)) { $column_type = ocicolumntype($R, $i); if( $column_type == NUMBER ) { print ocicolumnscale($R, $i ) . \n; print ocicolumnprecision($R, $i ) . \n; } } Expected result: Should Return 10 4 Actual result: -- Returns 0 0 -- Edit this bug report at http://bugs.php.net/?id=45039edit=1
#45039 [NEW]: OCI get number column length returns zero (0)
From: smelban at norwood dot com Operating system: Windows 2003 Enterprise Server PHP version: 5.2.6 PHP Bug Type: Oracle related Bug description: OCI get number column length returns zero (0) Description: We just recently upgraded from Oracle 10g to Oracle 11g. Since that move the ocicolumnscale and ocicolumnprecision functions have stopped returning the column length. Windows 2003 Enterprise Server Zend Core 2.5.0 PHP 5.2.5 Reproduce code: --- // mynumber field is a 10,4 decimal $sql = SELECT mynumber FROM TABLENAME; $R = OCIParse($c, $sql); OCIExecute($R); while (OCIFetch($R)) { $column_type = ocicolumntype($R, $i); if( $column_type == NUMBER ) { print ocicolumnscale($R, $i ) . \n; print ocicolumnprecision($R, $i ) . \n; } } Expected result: Should Return 10 4 Actual result: -- Returns 0 0 -- Edit bug report at http://bugs.php.net/?id=45039edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45039r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45039r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45039r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45039r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45039r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45039r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=45039r=needscript Try newer version:http://bugs.php.net/fix.php?id=45039r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45039r=support Expected behavior:http://bugs.php.net/fix.php?id=45039r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45039r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45039r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45039r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45039r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45039r=dst IIS Stability:http://bugs.php.net/fix.php?id=45039r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45039r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45039r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45039r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=45039r=mysqlcfg