6.0.0-beta1
7/22/25

[#443] SQL back-end for Preferences doesn't support long strings on Oracle
Summary SQL back-end for Preferences doesn't support long strings on Oracle
Queue Horde Framework Packages
Type Bug
State Resolved
Priority 1. Low
Owners
Requester selsky (at) columbia (dot) edu
Created 08/02/2004 (7659 days ago)
Due
Updated 08/11/2004 (7650 days ago)
Assigned
Resolved 08/11/2004 (7650 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/11/2004 01:46:54 AM Chuck Hagenbuch Comment #2
State ⇒ Resolved
Reply to this comment
Looks good. I've committed this to both HEAD and Horde 2.2.6-CVS 
(RELENG_2). Thanks!
08/02/2004 02:32:21 AM   New Attachment: sql.php.patch Download
 
08/02/2004 02:31:07 AM selsky (at) columbia (dot) edu Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ SQL back-end for Preferences doesn't support long strings on Oracle
Queue ⇒ Horde Framework Packages
Reply to this comment
I'm using Horde 2.2.5, IMP 3.2.5, and Turba 1.2.2 with Oracle 9.2 as 
the database back-end.



I've created my horde_prefs table as follows:



create table horde_prefs (

   pref_uid        varchar2(255) not null,

   pref_scope      varchar2(16) not null ,

   pref_name       varchar2(32) not null,

   pref_value      CLOB,

   constraint PK_HORDE_PREFS primary key (PREF_UID, PREF_SCOPE, PREF_NAME)

)



The CLOB is supposed to store more than 4K characters, but I still get 
the following error in horde.log:



[nativecode=ORA-01704: string literal too long] [on line 333 of 
"/www/horde/lib/Prefs/sql.php"]



The problem seems to be that CLOBs can only accept >4K characters when 
bind variables are used.  This means that prepare/execute 
(http://pear.php.net/manual/en/package.database.db.intro-execute.php
must be used instead of regular queries.



The following patch against Horde 2.x allows strings > 4K characters 
to be used.  This should work across databases.  My patch only changes 
the "update" and "insert" sections of sql.php.  The "select" sections 
seem to work fine, as is.

Saved Queries