php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2300 Can't select STRING (VARCHAR) values from the Oracle DB
Submitted: 1999-09-15 00:00 UTC Modified: 2006-07-17 08:52 UTC
From: admin at polad dot ru Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 3.0.12 OS: RedHat Linux 5.0 (kernel 2.0.38)
Private report: No CVE-ID: None
 [1999-09-15 00:00 UTC] admin at polad dot ru
OCIResult normaly gets the number and date values but it doesn't get varchar values.

  $conn = OCILogon("polad_sys", "polad_sys", "POLAD5-TCP.world");

  $sql = "select * from test";
  $stat = OCIParse($conn, $sql);

  OCIExecute($stat, OCI_DEFAULT);
  
  while (OCIFetch($stat)) {

    $ncols = OCINumCols($stat);
    for ( $i = 1; $i <= $ncols; $i++ ) {    
      $result = OCIResult($stat, $i);   /* !!!! */
      print $result;  /* using $result[1] I get the first char of the string */
      echo "<BR>";
    }
    echo "</TR>";
  }

  OCIFreeStatement($stat);  
  OCILogoff($conn);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-09-16 04:09 UTC] thies at cvs dot php dot net
Andrew said: 
Sorry, the problem was in Oracle client.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 07:01:26 2019 UTC