{"id":253,"date":"2012-07-24T11:31:31","date_gmt":"2012-07-24T15:31:31","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/acts\/?p=253"},"modified":"2012-07-24T19:29:46","modified_gmt":"2012-07-24T23:29:46","slug":"giving-up-on-yii-oracle-clobs","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/acts\/2012\/07\/24\/giving-up-on-yii-oracle-clobs\/","title":{"rendered":"Giving up on Yii Oracle Clobs"},"content":{"rendered":"<p>Started off yesterday with the intention of trying to implement functional Oracle Clobs in Yii similar to <a href=\"http:\/\/nik.chankov.net\/2008\/01\/03\/cakephp-and-oracle-handling-clob-fields\/\">how I implemented it in CakePHP<\/a> a couple years ago.  As yesterday went on I kept busting through boundaries and was feeling great about my progress.  But Then I hit the roadblock and I wasn&#8217;t able to continue.  It&#8217;s not worth spending another couple days on when I have a deadline for a pilot by Fall.  4000 characters is enough for the pilot.<\/p>\n<p>The result has been to alter the Yii <a href=\"https:\/\/github.com\/jazahn\/yii\/blob\/master\/framework\/db\/schema\/oci\/COciSchema.php\">COciSchema<\/a>.  Just changing the declaration of text to a varchar2(4000).<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n   public $columnTypes=array(\r\n        &#039;pk&#039; =&gt; &#039;NUMBER(10) NOT NULL PRIMARY KEY&#039;,\r\n        &#039;string&#039; =&gt; &#039;VARCHAR2(255)&#039;,\r\n        \/\/&#039;text&#039; =&gt; &#039;CLOB&#039;,\r\n        &#039;text&#039; =&gt; &#039;VARCHAR2(4000)&#039;,\r\n        &#039;integer&#039; =&gt; &#039;NUMBER(10)&#039;,\r\n        &#039;float&#039; =&gt; &#039;NUMBER&#039;,\r\n        &#039;decimal&#039; =&gt; &#039;NUMBER&#039;,\r\n        &#039;datetime&#039; =&gt; &#039;TIMESTAMP&#039;,\r\n        &#039;timestamp&#039; =&gt; &#039;TIMESTAMP&#039;,\r\n        &#039;time&#039; =&gt; &#039;TIMESTAMP&#039;,\r\n        &#039;date&#039; =&gt; &#039;DATE&#039;,\r\n        &#039;binary&#039; =&gt; &#039;BLOB&#039;,\r\n        &#039;boolean&#039; =&gt; &#039;NUMBER(1)&#039;,\r\n\t\t&#039;money&#039; =&gt; &#039;NUMBER(19,4)&#039;,\r\n    );\r\n<\/pre>\n<p>The issue is Yii (<a href=\"http:\/\/php.net\/manual\/en\/ref.pdo-oci.php\">PDO<\/a>) doesn&#8217;t support LOBs well at all, so that declaration didn&#8217;t make any sense to begin with.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Started off yesterday with the intention of trying to implement functional Oracle Clobs in Yii similar to how I implemented it in CakePHP a couple years ago. As yesterday went on I kept busting through boundaries and was feeling great about my progress. But Then I hit the roadblock and I wasn&#8217;t able to continue. [&hellip;]<\/p>\n","protected":false},"author":4571,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63924,1841,63942,3163,63928,63937],"tags":[63965,63960,4034,63953,63930,63943],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-atg","category-databases","category-oracle-databases","category-php","category-quizmo-atg","category-yii","tag-abstraction","tag-cakephp","tag-oracle","tag-pdo","tag-php-2","tag-yii-2"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/users\/4571"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/comments?post=253"}],"version-history":[{"count":4,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/253\/revisions"}],"predecessor-version":[{"id":257,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/253\/revisions\/257"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/media?parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/categories?post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/tags?post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}