#21915 [NEW]: ociBindByName doesn't work properly with char columns
| From: | michael dot virnstein at brodos dot de | Date: | Tue, 28 Jan 2003 08:22:09 +0000 |
| Subject: | #21915 [NEW]: ociBindByName doesn't work properly with char columns | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-31437@lists.php.net to get a copy of this message | ||
From: michael.virnstein@brodos.de
Operating system: Linux
PHP version: 4.2.3
PHP Bug Type: OCI8 related
Bug description: ociBindByName doesn't work properly with char columns
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 bug report at http://bugs.php.net/?id=21915&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21915&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21915&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21915&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21915&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21915&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21915&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21915&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21915&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21915&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21915&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21915&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21915&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21915&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=21915&r=gnused