| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2003-03-24 15:01 UTC] truth at ichaos dot com
 When odbc.defaultlrl is set to 4096 in the php.ini file, and I call odbc_longreadlen($result, 2000000); in my script, the data returned for that $result is padded at the end with garbage (prolly from memory). When the odbc.defaultlrl is set to 2000000 in the php.ini file, and I call odbc_longreadlen($result, 2000000); in my script, the data returned for that $result is not padded at the end with garbage, and is just fine. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 01:00:02 2025 UTC | 
All right, this snapshot didn't work. It's hard to write a script but here is a good try: First, a table in my IBM DB2 is created CREATE TABLE test ( ID INT, DATA CLOB(1M)); Put a string in the CLOB that is greater than 5K, and and ID = 1 or so. All right, now the script <? $linkid = odbc_connect("DBNAME", "USER", "PASSWORD"); $result = odbc_exec($linkid, "SELECT data FROM test WHERE id = 1"); odbc_longreadlen($result, 2000000); odbc_binmode($result, ODBC_BINMODE_PASSTHRU); $result = odbc_result($this->result, 1) echo strlen($result); ?> This should return the length of your string. If the odbc.defaultlrl is set to 4096, the string is 2000000 chars long. If odbc.defaultlrl is set to 2000000, the string is the correct length.