Informix SE char field limits
Posted in 2004
Topics: General Discussion
Hello, Using Informix SE .25 I have a table with a field char(5000). When I try to insert something greater than 256 chars I have the error -282. Why Informix lets me declare char fields greater than 256 bytes but then doesn't let me insert any big data? Thank you
"Gokusan" <dspa@NOSPAMlibero.it> wrote in message news:mKdFc.31593$GQ3.798773@twister2.libero.it... > Hello, > Using Informix SE .25 I have a table with a field char(5000). When I try to > insert > something greater than 256 chars I have the error -282. > Why Informix lets me declare char fields greater than 256 bytes but then > doesn't let me insert any big data? You can not use literal quotes > 256 bytes. For e.g insert into some_table values("THIS STRING CAN NOT BE GREATER THAN 256 BYTES"); declare a cursor and use a place holder. problem solved.
rkusenet wrote: > > "Gokusan" <dspa@NOSPAMlibero.it> wrote: > > Hello, > > Using Informix SE .25 I have a table with a field char(5000). When I try to > > insert > > something greater than 256 chars I have the error -282. > > Why Informix lets me declare char fields greater than 256 bytes but then > > doesn't let me insert any big data? > > You can not use literal quotes > 256 bytes. > > For e.g insert into some_table values("THIS STRING CAN NOT BE GREATER THAN 256 BYTES"); > > declare a cursor and use a place holder. problem solved. A very similar issue was discussed here just last week. See the thread entitled "String length exceeding 256 bytes (error 280)". One of the solutions recommended by Doug Lawry is one that I used years ago and works just fine; concatenate strings of 256 (or fewer) characters to reach the full size of your string. -- June Hunt