#17908 [Asn->Fbk]: Can't retrieve info using OCIColumnIsNULL()
| From: | sniper@php.net | Date: | Wed, 15 Oct 2003 01:01:28 +0000 |
| Subject: | #17908 [Asn->Fbk]: Can't retrieve info using OCIColumnIsNULL() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-49033@lists.php.net to get a copy of this message | ||
ID: 17908
Updated by: sniper@php.net
Reported By: ThorpeJ at gao dot gov
-Status: Assigned
+Status: Feedback
Bug Type: OCI8 related
Operating System: Linux 7.1
PHP Version: 4.0CVS-2002-06-21
Assigned To: maxim
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-10-20 15:33:55] 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.
------------------------------------------------------------------------
[2002-06-21 14:20:29] 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
}
/******************************************************/
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17908&edit=1