Bug #1970: OCIColumnName can only be called BEFORE OCIFetchInto
| From: | jjl at mars dot tuwien dot ac dot at | Date: | Thu, 05 Aug 1999 14:41:23 +0000 |
| Subject: | Bug #1970: OCIColumnName can only be called BEFORE OCIFetchInto | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-9558@lists.php.net to get a copy of this message | ||
From: jjl@mars.tuwien.ac.at
Operating system: Linux RH 5.2 i386
PHP version: 3.0.12
PHP Bug Type: Oracle related
Bug description: OCIColumnName can only be called BEFORE OCIFetchInto
If you try to do
$colname = OCIColumnName($stmt, $i)
AFTER you have called OCIFetchInto(...) then $colname will be empty.
If you call it BEFORE OciFetchInto everything works as it should.
This behaviour gave me a headache for a few hours...
So the correct way to do it should be:
OCIPLogon(...)
$stmt = OCIParse($query)
OCIExecute($stmt...)
for ($i=1; $i <= number of columns; $i++) {
$colname[$i] = OCIColumnName($stmt, $i);
}
while (OCIFetchInto(....)) {
// do smthng with the actual data
}