<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 09 Jul 2008 07:22:47 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Harun Yayli's Blog: oci_bind_by_name maxlength is not so optional]]></title>
      <guid>http://www.phpdeveloper.org/news/10156</guid>
      <link>http://www.phpdeveloper.org/news/10156</link>
      <description><![CDATA[<p>
<i>Harun Yayli</i> <a href="http://livebookmark.net/journal/2008/05/06/oci_bind_by_name-maxlength-is-not-so-optional/">came across</a> a slight problem in his development using the oci_bind_by_name function for one of his queries:
</p>
<blockquote>
If you think that the maxlength parameter in the documentation of oci_bind_by_name is optional, see this example and think again.
</blockquote>
<p>
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 <i>cj</i>) helps to explain things a bit more:
</p>
<blockquote>
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.
</blockquote>]]></description>
      <pubDate>Fri, 09 May 2008 13:45:44 -0500</pubDate>
    </item>
  </channel>
</rss>
