php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45445 odbc_field_len(), odbc_field_precision(), odbc_field_scale() - don't work
Submitted: 2008-07-07 10:05 UTC Modified: 2020-10-18 04:22 UTC
Votes:8
Avg. Score:3.2 ± 1.2
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: BunakovM at meta dot ua Assigned: cmb (profile)
Status: No Feedback Package: ODBC related
PHP Version: 5.2.6 OS: Windows XP, SP2
Private report: No CVE-ID: None
 [2008-07-07 10:05 UTC] BunakovM at meta dot ua
Description:
------------
The functions odbc_field_len(), odbc_field_precision(), odbc_field_scale() - don't work corractly when use Transbace ODBC driver in "SELECT ..." SQL-statement.

Reproduce code:
---------------
$con_str = "Driver={Transbase ODBC};Database=MyDB";
$db_conn = odbc_connect($con_str,"user","0")

$query = "SELECT * FROM Tab1";
$res = odbc_exec($db_conn, $query);
$num_fields = odbc_num_fields($res);
for($j=1; $j<=$num_fields; $j++){
  echo odbc_field_name($res,$j);
  echo '<br/>' . odbc_field_type($res,$j);
  echo '<br/>' . odbc_field_len($res,$j);
  echo '<br/>' . odbc_field_precision($res,$j);
  echo '<br/>' . odbc_field_scale($res,$j);
  echo '<br/>' . odbc_result($res,$j);
}

odbc_free_result($res);    // Free Result
odbc_close($db_conn);    // Close Connection

Expected result:
----------------
city_name
varchar
128
?
?
Kiyv

Actual result:
--------------
city_name
varchar
39806880
39770304
39805152
Kiyv

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-12 15:12 UTC] pits_1 at mail dot ru
Mikhail (Maksim?)!

I can not found ODBC-driver for TransBase 8-(((
Help me? PLS!

See http://www1.transaction.de/transaction/documentation.0.html?&L=1
Are PHP interface realy exist?

Peter S. from Russia, SPb
 [2016-06-13 13:04 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2016-06-13 13:04 UTC] cmb@php.net
Does this issue still persist? The ODBC extension had been
reworked for PHP 7.0.0, so please check with a recent PHP version.
 [2016-06-13 18:26 UTC] BunakovM at meta dot ua
Hi
I cannot test it now
Sorry
 [2016-06-15 00:19 UTC] cmb@php.net
-Status: Feedback +Status: Open
 [2020-10-05 08:00 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-10-05 08:00 UTC] cmb@php.net
If you still can reproduce this with any of the actively supported
PHP versions[1], please update the PHP version info, and an ODBC
trace of running the provided test script.

[1] <https://www.php.net/supported-versions.php>
 [2020-10-18 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 09:01:27 2024 UTC