php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11176 Bad results when retrieving IB decimal/float data type from stored procedures
Submitted: 2001-05-29 17:44 UTC Modified: 2002-04-13 13:41 UTC
From: alvarezje at hotmail dot com Assigned:
Status: Closed Package: InterBase related
PHP Version: 4.0.5 OS: Any
Private report: No CVE-ID: None
 [2001-05-29 17:44 UTC] alvarezje at hotmail dot com
Hi there,

Reposted from somewhere else:

-------------
Anyone who are using PHP + Interbase should be aware of this bugs especially
when trying to retrieve IB decimal/float data type from a stored
procedure(s). I have reproduced this error that seems as a bug on PHP when
retrieving data from ib that could be found in the attached file.

i tried to execute this query from IBConsole:

SELECT * FROM TEST_P;

and the result is:

94000581000
85000587000
27058581000
12334547000
12345678000

while PHP shows:

-488699512.21
-898758920.19
1288777224.6
-550354888.2
-539223888.2


-Jaimy

-------------------------------- TEST.SQL -----------------------

create table test (
    tbvalue decimal(18,3)
);
commit work;
insert into test values(94000581);
insert into test values(85000587);
insert into test values(27058581);
insert into test values(12334547);
insert into test values(12345678);
commit work;

set term ^;
create procedure test_p
returns (
   spvalue   decimal(18,3)
) as
begin
   for select tbValue from test into :spvalue do
   begin
        spvalue = spvalue * 1000;
        suspend;
   end
end
^
set term ;^
commit work;

------- TEST.PHP -----------------
<?

$dbh = ibase_connect("datacenter:d:/currdata/test.gdb","sysdba","xxxxxxx");
$sql_stat = "select spvalue from test_p;";
$ibqry= ibase_query($dbh, $sql_stat);
while ($row = ibase_fetch_row($ibqry)) {
 print $row[0]."<br>";
}
ibase_close($dbh);

?>
---------


By the way, thanks for such a great product as PHP!

Best Regards,

Jorge Alvarez

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-13 13:41 UTC] daniela@php.net
The version of PHP that this bug was reported in is too old. 
Please try the php-4.2.0RC3 from http://www.php.net/~derick/ 

If you are still able to reproduce the bug, please change the PHP
version on this bug report to the version you tested and change 
the status back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 04 21:01:29 2024 UTC