From: [EMAIL PROTECTED]
Operating system: Windows
PHP version: 4.3.0
PHP Bug Type: OCI8 related
Bug description: OCIBindByName trailing spaces
I guess I have a problem similar th ewone described in 14013.
When I use the OciBindByName, this function throw away the trailing spaces
which should be tranmitted via the bind variable. (When I'am using the old
Ora_Bind function it works like I expect).
For testing I minimized the problem to a "select from dual" to get it as
easy as possible.
I do four select-statement in each combination: the OCI- versus the old
Ora-functions and a bind-based versus a direct SQL-statement.
the php-code:
<?php
$conn = OciLogon ("X","Y","Z");
$val = " X X ";
$stm1 = OciParse($conn, "select '".$val."' from dual");
OciExecute($stm1);
OciFetch($stm1);
echo "<b>", OciResult($stm1, 1), "</b><br>\n";
$stm2 = OciParse($conn, "select :input from dual");
OciBindByName($stm2, ":input", &$val, 10);
OciExecute($stm2);
OciFetch($stm2);
echo "<b>", OciResult($stm2, 1), "</b><br>\n";
OciLogoff($conn);
$Conn = Ora_Logon ("X@Z","Y");
$val = " X X ";
$Cursor = Ora_Open($Conn);
Ora_Parse($Cursor, "select '".$val."' from dual");
Ora_Exec($Cursor);
Ora_Fetch($Cursor);
echo "<b>", Ora_getColumn($Cursor, 0), "</b><br>\n";
Ora_Parse($Cursor, "select :input from dual");
Ora_Bind($Cursor, "val", ":input", 10);
Ora_Exec($Cursor);
Ora_Fetch($Cursor);
echo "<b>", Ora_GetColumn($Cursor, 0), "</b><br>\n";
Ora_Logoff($Conn);
?>
The output is:
<html>
<body>
<b> X X </b><br>
<b> X X</b><br>
<b> X X </b><br>
<b> X X </b><br>
</body></html>
And the second (5th) line (OCIBindByName) in the output is the one I will
not accept, because the tailing blank is away.
Best wishes,
Jens Reibiger
--
Edit bug report at http://bugs.php.net/?id=22026&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22026&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22026&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22026&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22026&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22026&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22026&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22026&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22026&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22026&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22026&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22026&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22026&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22026&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22026&r=gnused