|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-10 03:23 UTC] kalowsky@php.net
[2004-11-03 16:52 UTC] arobins at csg dot uwaterloo dot ca
[2005-10-19 20:46 UTC] arobins at csg dot uwaterloo dot ca
[2005-10-24 17:55 UTC] kalowsky@php.net
[2005-10-24 18:29 UTC] wez@php.net
[2005-10-24 20:31 UTC] kalowsky@php.net
[2006-02-17 16:14 UTC] bobbyboyojones at hotmail dot com
[2015-04-11 17:10 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: cmb
[2015-04-11 17:10 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 17:00:02 2025 UTC |
Description: ------------ When retrieving ODBC results from Sybase SQL Anywhere 6 and 9, the column names are being truncated to 31 characters. This happens even if the column name is simply specified using sql 'AS' (i.e. "select column as a_really_long_name_that_is_longer_than_31_characters from crap" would still return "a_really_long_name_that_is_long" as the column name). Have tried in PHP 4 and 5, Win2K Server and SUSE Linux, all with same results. -- The buffer used by the odbc extension to store field names is only 32 bytes. Reproduce code: --------------- <?php $DBN = 'thedbn'; $UID = 'theuid'; $PWD = 'thepws'; $CONN = odbc_connect( $DBN, $UID, $PWD ) or die( "Cannot connect to $DBN."); $sql = "select * from crap"; $result = odbc_exec( $CONN, $sql ); for( $i = 1 ; $i <= odbc_num_fields( $result ) ; $i++ ) { $name = odbc_field_name( $result, $i ); ${$name} = odbc_result( $result, $name ); print( "$i: $name - ${$name}\n" ); } ?> Expected result: ---------------- 1: key - 4 2: a_really_long_name_that_is_longer_than_31_characters - 5 3: longer_name - 6 Actual result: -------------- 1: key - 4 2: a_really_long_name_that_is_long - 5 3: longer_name - 6