#21915 [Opn->Bgs]: ociBindByName doesn't work properly with char columns
| From: | sniper@php.net | Date: | Tue, 28 Jan 2003 11:41:38 +0000 |
| Subject: | #21915 [Opn->Bgs]: ociBindByName doesn't work properly with char columns | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-31459@lists.php.net to get a copy of this message | ||
ID: 21915
Updated by: sniper@php.net
Reported By: michael.virnstein@brodos.de
-Status: Open
+Status: Bogus
Bug Type: OCI8 related
Operating System: Linux
PHP Version: 4.2.3
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
PHP 4.3.0
Previous Comments:
------------------------------------------------------------------------
[2003-01-28 02:42:01] michael.virnstein@brodos.de
to make things clearer:
c_column is a char(10) column, but there's also data stored that is
shorter, e.g. 'text'. Therefore "Select * from t_table where c_column =
'text'" works.
------------------------------------------------------------------------
[2003-01-28 02:22:09] michael.virnstein@brodos.de
when i select from a oracle8i:
----------------------------------
$stmt = ociparse($conn, "Select * from t_table where c_column =
'text'");
ociexecute($stmt);
-------------------------
and c_column is a char column, everything works fine, even if the data
i'm asking for is shorter than the column.
(c_column is a char(10) and i'm looking for 'text')
but as soon as i use ocibindbyname, i won't get a result back:
-------------------------
$stmt = ociparse($conn, "Select * from t_table where c_column =
:bindvar");
$text = 'text';
ocibindbyname($stmt, ":bindvar", &$text, -1);
ociexecute($stmt);
-------------------------
it also doesn't work, if i set the length-parameter in ocibindbyname to
the length of the char column or lenght+1:
-------------------------
$stmt = ociparse($conn, "Select * from t_table where c_column =
:bindvar");
$text = 'text';
ocibindbyname($stmt, ":bindvar", &$text, 10);
ociexecute($stmt);
-------------------------
ocibindbyname only works with char columns, when the data of the
bindvariable is as long as the char column or if like-operator and % is
used:
-------------------------
$stmt = ociparse($conn, "Select * from t_table where c_column like
:bindvar");
$text = 'text%';
ocibindbyname($stmt, ":bindvar", &$text, -1);
ociexecute($stmt);
-------------------------
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21915&edit=1