note 88364 added to function.oci-bind-by-name
| From: | php at stock-consulting dot com | Date: | Wed, 21 Jan 2009 11:15:37 +0000 |
| Subject: | note 88364 added to function.oci-bind-by-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149583@lists.php.net to get a copy of this message | ||
If your database contains CHAR columns, you cannot use blank-padded comparison sematics with bind
variables. VARCHAR columns are not affected!
Example:
Table "tab" has a column "col" defined as "CHAR(20)". One row in the
table contains the value "hello world" in the column "col".
The query
SELECT * FROM tab WHERE col = 'hello world'
will return one row, as expected.
The query
SELECT * FROM tab WHERE col = :bindvar
will return zero rows if you bound :bindvar to 'hello world'. Since col is of type
CHAR(20), and :bindvar is apparently assumed to be of type VARCHAR2, Oracle will use use
NON-blank-padded comparision semantics.
----
Server IP: 217.13.201.10
Probable Submitter: 80.134.24.174
----
Manual Page -- http://www.php.net/manual/en/function.oci-bind-by-name.php
Edit -- https://master.php.net/note/edit/88364
Del: integrated -- https://master.php.net/note/delete/88364/integrated
Del: useless -- https://master.php.net/note/delete/88364/useless
Del: bad code -- https://master.php.net/note/delete/88364/bad+code
Del: spam -- https://master.php.net/note/delete/88364/spam
Del: non-english -- https://master.php.net/note/delete/88364/non-english
Del: in docs -- https://master.php.net/note/delete/88364/in+docs
Del: other reasons-- https://master.php.net/note/delete/88364
Reject -- https://master.php.net/note/reject/88364
Search -- https://master.php.net/manage/user-notes.php