News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Harun Yayli's Blog:
oci_bind_by_name maxlength is not so optional
May 09, 2008 @ 13:45:44

Harun Yayli came across a slight problem in his development using the oci_bind_by_name function for one of his queries:

If you think that the maxlength parameter in the documentation of oci_bind_by_name is optional, see this example and think again.

His sample code gave him a "can bind a LONG value only for insert into a LONG column..." error from his Oracle database. His fix was to add that length parameter (his max column length) and all was well. One of his comments (from cj) helps to explain things a bit more:

It makes senses that a length would be required because when the oci_bind_by_name() call is made, there is no data in $$key (a.k.a. $a, $b or $c). Without a length passed, PHP tells the DB to expect a single byte string.
0 comments voice your opinion now!
ocibindbyname maxlength optional error oracle


blog comments powered by Disqus

Similar Posts

Kian Hui Teo\'s Blog: Switching between PHP 5.1.x and Zend Core for Oracle

SitePoint PHP Blog: Pimpin Harry’s pretty bluescreen

Christopher Jones' Blog: New PDO_OCI Attributes

Zend: Four New Articles - Value Pak, ZendCore, InfoCard & Oracle

Gennady Feldman's Blog: Installing Oracle Instant Client 11g and PECL OCI8 (Part 2)


Community Events

Don't see your event here?
Let us know!


feature language wordpress extension release interview threedevsandamaybe voicesoftheelephpant podcast api introduction laravel development library opinion laravel5 community series framework unittest

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework