php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17908 Can't retrieve info using OCIColumnIsNULL()
Submitted: 2002-06-21 14:20 UTC Modified: 2003-10-19 10:24 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ThorpeJ at gao dot gov Assigned: maxim (profile)
Status: No Feedback Package: OCI8 related
PHP Version: 4.0CVS-2002-06-21 OS: Linux 7.1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-06-21 14:20 UTC] ThorpeJ at gao dot gov
I've tried using OCIColumnIsNULL() to retrieve info on which fields were NULL/NOT NULL in an Oracle database table, and the function did not return anything (using OCIColumnName, OCIColumnType, and OCIColumnSize in the same program worked fine). The script below is a simple example:

/******************************************************/
$conn = OCILogon($user, $pwd, $db);
$stmt = OCIParse($conn, "select * from $table");
OCIExecute($stmt);
$ncols = OCINumCols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
  echo "NAME: " . OCIColumnName($stmt,$i) . "<BR>";
  echo "TYPE: " . OCIColumnType($stmt,$i) . "<BR>";
  echo "SIZE: " . OCIColumnSize($stmt,$i) . "<BR>";
  echo "ISNULL: " . OCIColumnIsNULL($stmt,$i) . "<P>"; //Function does not return any information
}
/******************************************************/

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-20 15:33 UTC] maxim@php.net
true,

actually, what i noticed is that if you do a fetch *before* calling OCIColumnIsNULL() you then get the right results.

/******************************************************/
$conn = OCILogon($user, $pwd, $db);
$stmt = OCIParse($conn, "select * from $table");
OCIExecute($stmt);
$nrows = OCIFetchStatement($stmt, $res);  // adding this
$ncols = OCINumCols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
  echo "NAME: " . OCIColumnName($stmt,$i) . "<BR>";
  echo "TYPE: " . OCIColumnType($stmt,$i) . "<BR>";
  echo "SIZE: " . OCIColumnSize($stmt,$i) . "<BR>";
  echo "ISNULL: " . OCIColumnIsNULL($stmt,$i) . "<P>"; //Function does
not return any information
}
/******************************************************/

Will go to fix that.
 [2003-10-19 10:24 UTC] sniper@php.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 "Open". Thank you.


 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 02:03:33 2022 UTC