Christian Weber escribis:
>
> Hi all!
>
> Using Informix Online Dynamic Server 7.24UC3 on HPUX 10.20 i have the
> following problem:
>
> Having a website with an text-area form element, inserting this input into a
> database via "insert into..."-SQL-statement (using a web-database gateway).
>
> If the string exeeds more than 256 bytes, error -280 occurs in the users
> webbrowser:"A quoted string exeeds the allowable limit of 256 bytes."
>
> This errror occurs with any kind of Informix data type supporting char more
> than 256 length.
>
> It is a known bug at Informix hotline.
>
> There are three possibilities to insert this value:
>
> 1. Writing the value in ASCII in file system and inserting this into the
> database via "load from ... insert into ..."
> 2. Creating an ESQL/C program.
> 3. Splitting this data fild in 4 or more fields.
>
> ESQL/C is not allowed in this Web-application.
> Creating 4 fields requires splitting the string.
>
> Does anyone know a solution for the problem?
>
> Thanks!
Yes, split the string and then concatenate using || in sql.
example:
I cant remember the exact perl syntax here (and Informix sql also), but
the idea is to generate all necesary substrings
$sub1=substr($original_string, 0, 255);
$sub2=substr($original_string, 255, 255);
$sub3=substr($original_string, 512, 255);
$mysql= 'INSERT mylongstring INTO mytable VALUES("$sub1" || "$sub2" ||
"sub3")';
The concatenation could be inside a loop.
Hope this helps
Byte byte!
--
Mario R. Canto
mcanto@intec.unl.edu.ar
mcanto@intec.arcride.edu.ar
http://www.intec.unl.edu.ar/~mcanto