|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-03 05:53 UTC] maxim@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 17:00:01 2025 UTC |
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