Re: No resultset with ocibindbyname
| From: | Christopher Jones | Date: | Wed, 27 Feb 2008 19:37:17 +0000 |
| Subject: | Re: No resultset with ocibindbyname | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44679@lists.php.net to get a copy of this message | ||
Roberto Mansfield wrote:
PID NOT NULL CHAR(8)
I believe the problem has to do with your field type for PID. When you run: select * FROM projekte_generisch where pid='u0test' Oracle either autotrims or autopads (I'm not sure which) so that 'u0test' matches PID even though PID has a fixed 8-character length. But when you use bind variables, this doesn't happen. So you'll need to use:Hi Roberto, Well spotted! I can see a minor inconsistency between oci_bind_array_by_name() and the much older oci_bind_by_name() call. You can pass SQLT_AFC (i.e the CHAR type) to the former but not the latter. If anyone volunteers to write some test cases I can merge a patch to OCI8 to allow:
oci_bind_by_name($s, ':bv', $bv, -1, SQLT_AFC);Chris -- Christopher Jones, Oracle Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/ Free PHP Book: http://tinyurl.com/f8jad