Updated: I've made some changes to the CakePHP Clob Behavior
Bobby Borisov and Nedko Penev over at
chankov.net wrote a great
CakePHP behavior to help with handling Oracle clob fields in CakePHP 1.2. For those of you unfamiliar with Oracle, it will only let you insert or update a clob field with less than 4000 characters without using a bind variable. If you need to place a value into a clob field with over 4000 characters, your code will need to use Oracle binds.
CakePHP is a great package, but it is easy to see that its interactive with Oracle is limited at best. The dbo_oracle.php, the Oracle connection wrapper class, doesn't have any code for using a number of Oracle specific "features". The main one missing is the ability to bind variables.
This is where Bobby's and Nedko's clob behavior comes in. It is a great piece of code, however it contacted a handful of errors that we had to fix in order for it to work.
Warning
Due to the fact that CakePHP does not use behaviors when storing sessions in the database, if you are trying to store a session larger than 4000 characters in your Oracle database, using CakePHP 1.2, it will still throw ORA-01704: string literal too long.